File tree Expand file tree Collapse file tree
packages/react-scripts/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,17 +54,24 @@ function isInMercurialRepository() {
5454 }
5555}
5656
57- // Watch unless on CI, in coverage mode, or explicitly running all tests
57+ // Watch unless on CI, in coverage mode, explicitly adding `--no-watch`,
58+ // or explicitly running all tests
5859if (
5960 ! process . env . CI &&
6061 argv . indexOf ( '--coverage' ) === - 1 &&
62+ argv . indexOf ( '--no-watch' ) === - 1 &&
6163 argv . indexOf ( '--watchAll' ) === - 1
6264) {
6365 // https://github.com/facebook/create-react-app/issues/5210
6466 const hasSourceControl = isInGitRepository ( ) || isInMercurialRepository ( ) ;
6567 argv . push ( hasSourceControl ? '--watch' : '--watchAll' ) ;
6668}
6769
70+ // Jest doesn't have this option so we'll remove it
71+ if ( argv . indexOf ( '--no-watch' ) !== - 1 ) {
72+ argv = argv . filter ( arg => arg !== '--no-watch' ) ;
73+ }
74+
6875// @remove -on-eject-begin
6976// This is not necessary after eject because we embed config into package.json.
7077const createJestConfig = require ( './utils/createJestConfig' ) ;
You can’t perform that action at this time.
0 commit comments