From 19e0bb1881e24fb1ee3fe421413d4d87e67f68dd Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 15 Jan 2018 17:49:57 +0000 Subject: [PATCH] Support Jest --watchAll flag (#3804) * Support Jest --watchAll flag * Use clearer condition * Add comma --- packages/react-scripts/scripts/test.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index ee592d9b115..470e8e35721 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -33,8 +33,12 @@ if (process.env.SKIP_PREFLIGHT_CHECK !== 'true') { const jest = require('jest'); const argv = process.argv.slice(2); -// Watch unless on CI or in coverage mode -if (!process.env.CI && argv.indexOf('--coverage') < 0) { +// Watch unless on CI, in coverage mode, or explicitly running all tests +if ( + !process.env.CI && + argv.indexOf('--coverage') === -1 && + argv.indexOf('--watchAll') === -1 +) { argv.push('--watch'); }