Skip to content
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

Merged
merged 2 commits into from
Apr 12, 2017
Merged

Refactor watch mode prompts. #3290

merged 2 commits into from
Apr 12, 2017

Conversation

cpojer
Copy link
Member

@cpojer cpojer commented Apr 12, 2017

Summary

Part of #3156, pulled out for easier review and more incremental shipping.

cc @thymikee @zouxuoz

Test plan
jest

constructor(pipe: stream$Writable | tty$WriteStream, prompt: Prompt) {
this._pipe = pipe;
this._prompt = prompt;
(this: any).onChange = this.onChange.bind(this);
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

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}`;
Copy link
Collaborator

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.

Copy link
Collaborator

@thymikee thymikee left a 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!

@cpojer cpojer merged commit 77ce9ec into jestjs:master Apr 12, 2017
@codecov-io
Copy link

Codecov Report

Merging #3290 into master will increase coverage by <.01%.
The diff coverage is 94.18%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
packages/jest-cli/src/watch.js 64.61% <75%> (ø) ⬆️
packages/jest-cli/src/TestNamePatternPrompt.js 94.33% <93.02%> (ø) ⬆️
packages/jest-cli/src/TestPathPatternPrompt.js 98.03% <97.43%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b0f470e...036f2f5. Read the comment docs.

skovhus pushed a commit to skovhus/jest that referenced this pull request Apr 29, 2017
* Refactor watch mode prompts.

* Update internal API names; remove binding in the constructor.
@cpojer cpojer deleted the prompts branch May 4, 2017 15:44
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Refactor watch mode prompts.

* Update internal API names; remove binding in the constructor.
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants