CodingZeal/generator-react-zeal

Differentiate between test and test:watch.

Closed this issue · 0 comments

The stock react-scripts project only defines a test script that runs jest with --watch by default. That means that we can't run yarn validate without watch mode starting up.

I can think of at least two options:

  1. Define a new script in our fork to run tests in non-watch mode.

  2. Looking at the test script, it will not add the --watch flag if either CI is set in the env, or if we run the test script with the --coverage argument. So, we could define a test command that ran react-scripts test --coverage and a test:watch command that ran react-scripts test.