-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
cli: Hide Watch Usage output when running on non-interactive envs #4958
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
76a4e99
cli: Hide Watch Usage output when running on non-interactive environm…
taylon 3d03131
cli: Hide no test found related messages on non-interactive environments
taylon 4543648
Move isInteractive to jest-util
taylon 3f2a4e4
Use isInteractive in other parts of the code
taylon 9aa475f
Fix tests that depend on interactive environment
taylon 5601237
Fix tests in AppVeyor and add tests to the is_interactive module
taylon 96bbe1d
Update CHANGELOG for #4958
taylon e0ccdf1
Merge branch 'master' into watchusage
cpojer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
packages/jest-cli/src/__tests__/__snapshots__/watch.test.js.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| import isCI from 'is-ci'; | ||
|
|
||
| export default process.stdout.isTTY && !isCI; | ||
18 changes: 12 additions & 6 deletions
18
packages/jest-cli/src/get_no_test_found_related_to_changed_files.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,18 @@ | ||
| import chalk from 'chalk'; | ||
| import isInteractive from './check_if_interative'; | ||
|
|
||
| export default function getNoTestFoundRelatedToChangedFiles(globalConfig) { | ||
| return ( | ||
| chalk.bold('No tests found related to files changed since last commit.\n') + | ||
| chalk.dim( | ||
| globalConfig.watch | ||
| let msg = chalk.bold( | ||
| 'No tests found related to files changed since last commit.', | ||
| ); | ||
|
|
||
| if (isInteractive) { | ||
| msg += chalk.dim( | ||
| '\n' + globalConfig.watch | ||
| ? 'Press `a` to run all tests, or run Jest with `--watchAll`.' | ||
| : 'Run Jest without `-o` or with `--all` to run all tests.', | ||
| ) | ||
| ); | ||
| ); | ||
| } | ||
|
|
||
| return msg; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
NIT: I think we could name this file
is_interactiveso that the import looks like 'import isInteractive from './is_interactive'...I could even be nice if this was in something like
jest-utiland then we could use it in other places of the codebase like