test_runner: refactor to use min/max of `validateInteger` · nodejs/node@07c601e · GitHub
Skip to content

Commit 07c601e

Browse files
deokjinkimtargos
authored andcommitted
test_runner: refactor to use min/max of validateInteger
Instead of additional `if` statement, use min/max of `validateInteger` for `shard.index`. PR-URL: #53148 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent e26166f commit 07c601e

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

lib/internal/test_runner/runner.js

Lines changed: 1 addition & 6 deletions

test/parallel/test-runner-cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ const testFixtures = fixtures.path('test-runner');
238238

239239
assert.strictEqual(child.status, 1);
240240
assert.strictEqual(child.signal, null);
241-
assert.match(child.stderr.toString(), /The value of "options\.shard\.index" is out of range\. It must be >= 1 && <= 3 \("options\.shard\.total"\)\. Received 0/);
241+
assert.match(child.stderr.toString(), /The value of "options\.shard\.index" is out of range\. It must be >= 1 && <= 3\. Received 0/);
242242
const stdout = child.stdout.toString();
243243
assert.strictEqual(stdout, '');
244244
}

test/parallel/test-runner-run.mjs

Lines changed: 2 additions & 4 deletions

0 commit comments

Comments
 (0)