File tree 1 file changed +8
-1
lines changed
packages/react-scripts/scripts
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -54,17 +54,24 @@ function isInMercurialRepository() {
54
54
}
55
55
}
56
56
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
58
59
if (
59
60
! process . env . CI &&
60
61
argv . indexOf ( '--coverage' ) === - 1 &&
62
+ argv . indexOf ( '--no-watch' ) === - 1 &&
61
63
argv . indexOf ( '--watchAll' ) === - 1
62
64
) {
63
65
// https://github.com/facebook/create-react-app/issues/5210
64
66
const hasSourceControl = isInGitRepository ( ) || isInMercurialRepository ( ) ;
65
67
argv . push ( hasSourceControl ? '--watch' : '--watchAll' ) ;
66
68
}
67
69
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
+
68
75
// @remove -on-eject-begin
69
76
// This is not necessary after eject because we embed config into package.json.
70
77
const createJestConfig = require ( './utils/createJestConfig' ) ;
You can’t perform that action at this time.
0 commit comments