Closed
Description
If you are reporting a bug, please fill in below. Otherwise feel to remove this template entirely.
Description
I want the tests to terminate after running once. But there doesn't seem to be any way to disable this behavior except setting the CI
environment variable like: "test": "CD=true react-scripts test --env=jsdom",
in package.json. I traced the source of this behavior to these lines in test.js
// Watch unless on CI
if (!process.env.CI) {
argv.push('--watch');
}
I understand that watching can be good when in the development cycle but when I want to run the tests in a pipeline or some script or git push hooks, I want to escape this mechanism.
Expected behavior
One of these
- Make the
npm test
run only once and then make another one callednpm run test:watch
that watches. - Maybe add another package.json script called
npm run test:once
Actual behavior
Tell us what actually happens.
Environment
react-scripts@0.4.1
node@6.5.0
npm@3.10.3
I can make a PR if this behavior is confirmed.