From 0019ce7c6a41e7563ed421ce5f05107397a29039 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Sat, 26 Jan 2019 19:14:26 -0500 Subject: [PATCH 1/5] allow --watch=false --- packages/react-scripts/scripts/test.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index ac07e4792af..af174fc3d91 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -58,7 +58,8 @@ function isInMercurialRepository() { if ( !process.env.CI && argv.indexOf('--coverage') === -1 && - argv.indexOf('--watchAll') === -1 + argv.indexOf('--watchAll') === -1 && + argv.indexOf('--watch=false') === -1 ) { // https://github.com/facebook/create-react-app/issues/5210 const hasSourceControl = isInGitRepository() || isInMercurialRepository(); From 5917f835b75a7d350dd8e494961823c80e436f47 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Thu, 31 Jan 2019 15:10:18 -0500 Subject: [PATCH 2/5] look for --no-watch instead of --watch=false --- packages/react-scripts/scripts/test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index af174fc3d91..bf140dcbde5 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -54,12 +54,13 @@ 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('--watchAll') === -1 && - argv.indexOf('--watch=false') === -1 + argv.indexOf('--no-watch') === -1 && + argv.indexOf('--watchAll') === -1 ) { // https://github.com/facebook/create-react-app/issues/5210 const hasSourceControl = isInGitRepository() || isInMercurialRepository(); From 25bdcaf2a781d04d902284b5cf48a9b470ecb65c Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Fri, 1 Feb 2019 03:09:37 -0500 Subject: [PATCH 3/5] remove --no-watch flag --- packages/react-scripts/scripts/test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index bf140dcbde5..ada56690d6e 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -67,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.splice(argv.indexOf('--no-watch'), 1); +} + // @remove-on-eject-begin // This is not necessary after eject because we embed config into package.json. const createJestConfig = require('./utils/createJestConfig'); From 296b18274a97b11f101e6283465fbde365498d42 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Fri, 1 Feb 2019 03:15:08 -0500 Subject: [PATCH 4/5] make caps --- packages/react-scripts/scripts/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index ada56690d6e..8faab647e7b 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -67,7 +67,7 @@ if ( argv.push(hasSourceControl ? '--watch' : '--watchAll'); } -// jest doesn't have this option so we'll remove it +// Jest doesn't have this option so we'll remove it if (argv.indexOf('--no-watch') !== -1) { argv.splice(argv.indexOf('--no-watch'), 1); } From 1f7c6a904095651d02407ed6d418aba071947147 Mon Sep 17 00:00:00 2001 From: Rico Kahler Date: Fri, 1 Feb 2019 03:24:36 -0500 Subject: [PATCH 5/5] filter instead --- packages/react-scripts/scripts/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index 8faab647e7b..3659e8bc151 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -69,7 +69,7 @@ if ( // Jest doesn't have this option so we'll remove it if (argv.indexOf('--no-watch') !== -1) { - argv.splice(argv.indexOf('--no-watch'), 1); + argv = argv.filter(arg => arg !== '--no-watch'); } // @remove-on-eject-begin