Add '--no-watch' flag for tests (#6285)

This commit is contained in:
Rico Kahler
2019-02-01 10:49:52 -05:00
committed by Brody McKee
parent 714599dae6
commit af339ec343

View File

@@ -54,10 +54,12 @@ function isInMercurialRepository() {
}
}
// Watch unless on CI, in coverage mode, or explicitly running all tests
// Watch unless on CI, in coverage mode, explicitly adding `--no-watch`,
// or explicitly running all tests
if (
!process.env.CI &&
argv.indexOf('--coverage') === -1 &&
argv.indexOf('--no-watch') === -1 &&
argv.indexOf('--watchAll') === -1
) {
// https://github.com/facebook/create-react-app/issues/5210
@@ -65,6 +67,11 @@ if (
argv.push(hasSourceControl ? '--watch' : '--watchAll');
}
// Jest doesn't have this option so we'll remove it
if (argv.indexOf('--no-watch') !== -1) {
argv = argv.filter(arg => arg !== '--no-watch');
}
// @remove-on-eject-begin
// This is not necessary after eject because we embed config into package.json.
const createJestConfig = require('./utils/createJestConfig');