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

Allow react-scripts test --no-watch #6285

Merged
merged 5 commits into from
Feb 1, 2019
Merged

Allow react-scripts test --no-watch #6285

merged 5 commits into from
Feb 1, 2019

Conversation

ricokahler
Copy link
Contributor

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 linking my local fork to a project created with create-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:

jest-watch-false

@facebook-github-bot
Copy link

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!

@facebook-github-bot
Copy link

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
Copy link
Contributor

@mrmckeb mrmckeb Jan 31, 2019

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!

@ricokahler ricokahler changed the title Allow react-scripts test --watch=false Allow react-scripts test --no-watch Feb 1, 2019
Copy link
Contributor

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

@mrmckeb mrmckeb merged commit af339ec into facebook:master Feb 1, 2019
@mrmckeb
Copy link
Contributor

mrmckeb commented Feb 1, 2019

Thanks @ricokahler, and congratulations on your first CRA PR :)

@mrmckeb
Copy link
Contributor

mrmckeb commented Feb 1, 2019

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.

@ricokahler
Copy link
Contributor Author

@mrmckeb here ya go: #6331

Thanks @ricokahler, and congratulations on your first CRA PR :)

thanks for the opportunity lol. I appreciate it

@lock lock bot locked and limited conversation to collaborators Feb 6, 2019
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.

3 participants