-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Allow react-scripts test --no-watch #6285
Allow react-scripts test --no-watch #6285
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
@@ -58,7 +58,8 @@ function isInMercurialRepository() { | |||
if ( | |||
!process.env.CI && | |||
argv.indexOf('--coverage') === -1 && | |||
argv.indexOf('--watchAll') === -1 | |||
argv.indexOf('--watchAll') === -1 && | |||
argv.indexOf('--watch=false') === -1 |
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.
Let's use --no-watch
, as this is a flag more than an option :)
Can you also sort this alphabetically? Thanks!
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.
I'm sorry, @ricokahler. I just thought of one thing...
We should remove this flag from the args we pass to Jest. Even though it's meaningless, it's not good practice to pass it through.
If you can remove it from argv
, (I'd suggest you could do it around line 69) I can merge this in. Thanks!
Thanks @ricokahler, and congratulations on your first CRA PR :) |
Also, @ricokahler, if you'd like you could raise a PR to add this to the docs. Otherwise I can have a look, just let me know ASAP. |
thanks for the opportunity lol. I appreciate it |
This is a one-line pull request for #6284. This allows
react-scripts test --watch=false
to allow react-scripts to run jest without watch mode.I tested this out by
npm link
ing my local fork to a project created withcreate-react-app
.I ran the command
npm t -- --watch=false
and jest closed right after everything was ran!See the gif, when
--watch=false
is added, it no longer adds the--watch
: