Skip to content

Conversation

randycoulman
Copy link
Contributor

Most of our JS packages have test and test:watch scripts, where test runs the tests once and test:watch continuously runs them as files change. However, create-react-app defines only a test target that normally watches, but switches into “run once” mode if the CI env var is set to true. We originally wanted to keep our generator consistent with CRA, so we had a test target that does watch mode, and added a separate test:once target for doing a one-time run.

This PR changes the scripts back to our normal convention of test and test:watch.

It’s kinda weird to have the test task forward on to the test:watch task, but I didn’t want to repeat the react-scripts call in two places.

Copy link
Contributor

@casto101 casto101 left a comment

Choose a reason for hiding this comment

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

It feels weird to me too that test forwards to test:watch. It doesn't feel like unnecessary duplication to have react-scripts called in both commands, because it might be a little clearer as to what each script is doing. But I'll approve this anyway, and leave changing it to your discretion--it's fine as it is, too.

It seemed weird to have the `test` script forward on to the
`test:watch` script instead of the other way around, so instead I
decided to duplicate the `react-scripts test` call.  They’re
side-by-side, and it’s not much duplication, so we can live with it.
@casto101
Copy link
Contributor

casto101 commented May 9, 2017

👍

@randycoulman randycoulman merged commit 0c8c2c6 into master May 9, 2017
@randycoulman randycoulman deleted the feature/test-script-names branch May 9, 2017 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants