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

Disable jest watch mode when --coverage flag is present [#1207] #1229

Merged
merged 1 commit into from
Dec 11, 2016

Conversation

BenoitAverty
Copy link
Contributor

This PR adds the enhancement described in #1207.

I just added this condition to the addition of the '--watch' flag in the test script. I tested this on my computer and it seems to do the trick, i'm guessing the rest is handled by Jest (make all the tests run when not in watch mode, versus only run tests modified since last commit when watch mode is active).

If there's something I forgot, please let me know.

Also I ran the tasks/e2e.sh script, and it hangs on line 181
npm run test -- --watch=no because it does, in fact, run in watch mode. You have to press 'q' for the script to continue. Is this normal or a regression I introduced ? This seems to be true even on master...

Finally, is there something to add to test the new behavior?

@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 - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions.

@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!

@gaearon
Copy link
Contributor

gaearon commented Dec 10, 2016

Does this work when I pass more than one flag?

npm test -- --coverage App

Not sure it makes any sense, it's just that I don't remember how argv works.

@BenoitAverty
Copy link
Contributor Author

In most languages, argv is an array of strings, which is the command line split on each space. In your case it's [ '--coverage', 'App' ], so it works as expected (I just tested it on my machine)

@gaearon gaearon added this to the 0.8.4 milestone Dec 10, 2016
@gaearon gaearon merged commit a60140f into facebook:master Dec 11, 2016
@gaearon
Copy link
Contributor

gaearon commented Dec 11, 2016

Thank you!

@gaearon gaearon mentioned this pull request Dec 11, 2016
alexdriaguine pushed a commit to alexdriaguine/create-react-app that referenced this pull request Jan 23, 2017
randycoulman pushed a commit to CodingZeal/create-react-app that referenced this pull request May 8, 2017
@lock lock bot locked and limited conversation to collaborators Jan 21, 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