Skip to content

Commit 524ffe8

Browse files
committed
test_runner: avoid validating options.bail if not provided
1 parent 1183d02 commit 524ffe8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/internal/test_runner/runner.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ function run(options = kEmptyObject) {
588588
execArgv = [],
589589
argv = [],
590590
cwd = process.cwd(),
591-
bail = false,
591+
bail,
592592
} = options;
593593

594594
if (files != null) {
@@ -688,14 +688,16 @@ function run(options = kEmptyObject) {
688688

689689
validateStringArray(argv, 'options.argv');
690690
validateStringArray(execArgv, 'options.execArgv');
691-
validateBoolean(bail, 'options.bail');
692-
// TODO(pmarchini): watch mode with bail needs to be implemented
693-
if (bail && watch) {
694-
throw new ERR_INVALID_ARG_VALUE(
695-
'options.bail',
696-
watch,
697-
'bail is not supported while watch mode is enabled',
698-
);
691+
if (bail != null) {
692+
validateBoolean(bail, 'options.bail');
693+
// TODO(pmarchini): watch mode with bail needs to be implemented
694+
if (bail && watch) {
695+
throw new ERR_INVALID_ARG_VALUE(
696+
'options.bail',
697+
watch,
698+
'bail is not supported while watch mode is enabled',
699+
);
700+
}
699701
}
700702

701703
const rootTestOptions = { __proto__: null, concurrency, timeout, signal };

0 commit comments

Comments
 (0)