Skip to content

Commit

Permalink
test_runner: avoid validating options.bail if not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
pmarchini committed Jan 19, 2025
1 parent 1183d02 commit 524ffe8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ function run(options = kEmptyObject) {
execArgv = [],
argv = [],
cwd = process.cwd(),
bail = false,
bail,
} = options;

if (files != null) {
Expand Down Expand Up @@ -688,14 +688,16 @@ function run(options = kEmptyObject) {

validateStringArray(argv, 'options.argv');
validateStringArray(execArgv, 'options.execArgv');
validateBoolean(bail, 'options.bail');
// TODO(pmarchini): watch mode with bail needs to be implemented
if (bail && watch) {
throw new ERR_INVALID_ARG_VALUE(
'options.bail',
watch,
'bail is not supported while watch mode is enabled',
);
if (bail != null) {
validateBoolean(bail, 'options.bail');
// TODO(pmarchini): watch mode with bail needs to be implemented
if (bail && watch) {
throw new ERR_INVALID_ARG_VALUE(
'options.bail',
watch,
'bail is not supported while watch mode is enabled',
);
}
}

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

0 comments on commit 524ffe8

Please sign in to comment.