Update: my use case is mainly to run tests at CI, but overriding default CRA Jest parameters is something I\'m generally wondering about.
I\'m run
You should use Jests --watchAll=false flag.
eg:
npm test -- --watchAll=false
Note: this is for react-scripts > 3.00
For older versions:
>= 2.1.4 < 3.00For non-ci, eg running tests locally, you can pass a --no-watch flag:
npm test --no-watch
<= 2.1.3CRA looks for a CI environment variable, if its present it doesn't run in watch mode.
CI=true npm test should do what you are looking for
See the User Guide -> Running Tests -> On your own environment