Skip to content

Commit 41e4dca

Browse files
author
Alex Ewerlöf
committed
added support for disabling test watch with more variable names
See #784
1 parent dc6074a commit 41e4dca

File tree

1 file changed

+3
-1
lines changed
  • packages/react-scripts/scripts

1 file changed

+3
-1
lines changed

packages/react-scripts/scripts/test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ require('dotenv').config({silent: true});
2020

2121
const jest = require('jest');
2222
const argv = process.argv.slice(2);
23+
// If any of these environment variables exist, don't add --watch to Jest args
24+
const ENV_WITHOUT_WATCH = ['CI', 'COVERAGE', 'NO_TEST_WATCH'];
2325

2426
// Watch unless on CI
25-
if (!process.env.CI) {
27+
if (!ENV_WITHOUT_WATCH.some( eww => eww in process.env)) {
2628
argv.push('--watch');
2729
}
2830

0 commit comments

Comments
 (0)