Skip to content

Commit 180116b

Browse files
committed
fixup! hoist timeoutPerTest out of if
1 parent 07863c5 commit 180116b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/internal/test_runner/utils.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ function parseCommandLine() {
196196
const sourceMaps = getOptionValue('--enable-source-maps');
197197
const updateSnapshots = getOptionValue('--test-update-snapshots');
198198
const watch = getOptionValue('--watch');
199+
const timeoutPerTest = getOptionValue('--test-timeout') || Infinity;
199200
const isChildProcess = process.env.NODE_TEST_CONTEXT === 'child';
200201
const isChildProcessV8 = process.env.NODE_TEST_CONTEXT === 'child-v8';
201202
let concurrency;
@@ -211,7 +212,6 @@ function parseCommandLine() {
211212
let shard;
212213
let testNamePatterns = mapPatternFlagToRegExArray('--test-name-pattern');
213214
let testSkipPatterns = mapPatternFlagToRegExArray('--test-skip-pattern');
214-
let timeoutPerTest;
215215

216216
if (isChildProcessV8) {
217217
kBuiltinReporters.set('v8-serializer', 'internal/test_runner/reporter/v8-serializer');
@@ -242,7 +242,6 @@ function parseCommandLine() {
242242

243243
if (isTestRunner) {
244244
isolation = getOptionValue('--test-isolation');
245-
timeoutPerTest = getOptionValue('--test-timeout') || Infinity;
246245

247246
if (isolation === 'none') {
248247
concurrency = 1;
@@ -271,7 +270,6 @@ function parseCommandLine() {
271270
};
272271
}
273272
} else {
274-
timeoutPerTest = getOptionValue('--test-timeout') || Infinity;
275273
concurrency = 1;
276274
const testNamePatternFlag = getOptionValue('--test-name-pattern');
277275
only = getOptionValue('--test-only');

0 commit comments

Comments
 (0)