Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! test_runner: validate concurrency option
  • Loading branch information
aduh95 committed Jul 24, 2022
commit 944b575738b297876ba29a0dff385f45ae36727c
6 changes: 3 additions & 3 deletions lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const { once } = require('events');
const { AbortController } = require('internal/abort_controller');
const {
codes: {
ERR_INVALID_ARG_TYPE,
ERR_TEST_FAILURE,
},
kIsNodeError,
Expand All @@ -36,7 +37,6 @@ const {
validateAbortSignal,
validateNumber,
validateUint32,
validateOneOf,
} = require('internal/validators');
const { setTimeout } = require('timers/promises');
const { TIMEOUT_MAX } = require('internal/timers');
Expand Down Expand Up @@ -152,7 +152,7 @@ class Test extends AsyncResource {

switch (typeof concurrency) {
case 'number':
validateUint32(concurrency, 'concurrency', 1);
validateUint32(concurrency, 'options.concurrency', 1);
this.concurrency = concurrency;
break;

Expand All @@ -166,7 +166,7 @@ class Test extends AsyncResource {

default:
if (concurrency != null)
validateOneOf(concurrency, 'concurrency', ['boolean', 'number']);
throw new ERR_INVALID_ARG_TYPE('options.concurrency', ['boolean', 'number'], concurrency);
}

if (timeout != null && timeout !== Infinity) {
Expand Down