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

feat: add jest-watch package #6318

Merged
merged 3 commits into from
May 28, 2018
Merged

feat: add jest-watch package #6318

merged 3 commits into from
May 28, 2018

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented May 27, 2018

Summary

This splits out the parts needed to make watch plugins out of jest-cli into a new package called jest-watch. I'm quite unfamiliar with watch mode, so I might have missed something, or included something which doesn't have to move

Test plan

All existing tests should pass.

@@ -13,7 +13,8 @@ import type {AggregatedResult, AssertionLocation} from 'types/TestResult';
const chalk = require('chalk');
const ansiEscapes = require('ansi-escapes');
const {pluralize} = require('./reporters/utils');
const {KEYS, ARROW} = require('./constants');
const {ARROW} = require('./constants');
import {KEYS} from 'jest-watch';
Copy link
Collaborator

@thymikee thymikee May 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move import above consts

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, why are these requires? Didn't even notice

"dependencies": {
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.1",
"string-length": "^2.0.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure these are all deps jest-watch use

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied jest-cli and removed unused stuff, so it should be enough

Copy link
Member Author

@SimenB SimenB May 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haven't checked if I can remove anything from jest-cli, though, lemme do that

EDIT: All 3 still used in cli

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.

Nice!

Copy link
Contributor

@rogeliog rogeliog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'm just curious about what the responsibilities of jest-watch are going to be?

  • Should this eventually evolve into a standalone "watch" package that can watch a filesystem and execute stuff against it and react to fs events? Or should it mainly be a place to make the initial plugins easier to develop?

@SimenB
Copy link
Member Author

SimenB commented May 27, 2018

Or should it mainly be a place to make the initial plugins easier to develop?

This I think. So maybe the name is too generic? We already have jest-haste-map for fs stuff.

@codecov-io
Copy link

Codecov Report

Merging #6318 into master will increase coverage by 0.22%.
The diff coverage is 86.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6318      +/-   ##
==========================================
+ Coverage   63.65%   63.87%   +0.22%     
==========================================
  Files         227      228       +1     
  Lines        8637     8698      +61     
  Branches        3        3              
==========================================
+ Hits         5498     5556      +58     
- Misses       3138     3141       +3     
  Partials        1        1
Impacted Files Coverage Δ
packages/jest-cli/src/test_path_pattern_prompt.js 46.66% <ø> (ø) ⬆️
packages/jest-cli/src/constants.js 100% <ø> (ø) ⬆️
...st-cli/src/plugins/update_snapshots_interactive.js 65.51% <ø> (ø) ⬆️
.../jest-watch/src/lib/format_test_name_by_pattern.js 89.47% <ø> (ø)
packages/jest-watch/src/lib/colorize.js 100% <ø> (ø)
packages/jest-cli/src/test_name_pattern_prompt.js 44.44% <ø> (ø) ⬆️
packages/jest-cli/src/plugins/test_name_pattern.js 100% <ø> (ø) ⬆️
packages/jest-cli/src/plugins/test_path_pattern.js 100% <ø> (ø) ⬆️
packages/jest-cli/src/plugins/update_snapshots.js 100% <ø> (ø) ⬆️
packages/jest-cli/src/run_jest.js 69.41% <ø> (ø) ⬆️
... and 19 more

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 d59017d...d6c0f40. Read the comment docs.

@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 12, 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.

None yet

6 participants