diff --git a/package.json b/package.json index a9f6b18192f..d08dcda5470 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "get-port": "^4.2.0", "globby": "^9.1.0", "husky": "^1.3.1", + "is-ci": "^2.0.0", "jest": "24.9.0", "lerna": "3.19.0", "lerna-changelog": "~0.8.2", diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index 010bc2904a9..0d3f4bbf55d 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -33,6 +33,7 @@ verifyTypeScriptSetup(); // @remove-on-eject-end const jest = require('jest'); +const isCI = require('is-ci') const execSync = require('child_process').execSync; let argv = process.argv.slice(2); @@ -56,7 +57,7 @@ function isInMercurialRepository() { // Watch unless on CI or explicitly running all tests if ( - !process.env.CI && + !isCI && argv.indexOf('--watchAll') === -1 && argv.indexOf('--watchAll=false') === -1 ) {