-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor watch mode prompts. #3290
Conversation
constructor(pipe: stream$Writable | tty$WriteStream, prompt: Prompt) { | ||
this._pipe = pipe; | ||
this._prompt = prompt; | ||
(this: any).onChange = this.onChange.bind(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't onChange
be a class propety? You could avoid casting to any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Flow you cannot overwrite class methods. I'll just get rid of this though, we don't need to bind this upfront really.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, missed that. Good call 👍
pipe.write(ansiEscapes.cursorSavePosition); | ||
const total = matchedTests.length; | ||
const results = matchedTests.slice(0, max); | ||
const inputText = `${chalk.dim(' pattern \u203A')} ${pattern}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Later we could extract this \u203A
char to something readable, as it's shared across multiple files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. ?w=1
makes checking this diff a breeze!
Codecov Report
@@ Coverage Diff @@
## master #3290 +/- ##
==========================================
+ Coverage 63.89% 63.89% +<.01%
==========================================
Files 176 176
Lines 6472 6473 +1
Branches 4 4
==========================================
+ Hits 4135 4136 +1
Misses 2336 2336
Partials 1 1
Continue to review full report at Codecov.
|
* Refactor watch mode prompts. * Update internal API names; remove binding in the constructor.
* Refactor watch mode prompts. * Update internal API names; remove binding in the constructor.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Part of #3156, pulled out for easier review and more incremental shipping.
cc @thymikee @zouxuoz
Test plan
jest