| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2bcce32 commit 9a36258
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -536,11 +536,7 @@ function run(options) { | |||
| 536 | 536 | shard = { __proto__: null, index: shard.index, total: shard.total }; | |
| 537 | 537 | ||
| 538 | 538 | validateInteger(shard.total, 'options.shard.total', 1); | |
| 539 | - validateInteger(shard.index, 'options.shard.index'); | ||
| 540 | - | ||
| 541 | - if (shard.index <= 0 || shard.total < shard.index) { | ||
| 542 | - throw new ERR_OUT_OF_RANGE('options.shard.index', `>= 1 && <= ${shard.total} ("options.shard.total")`, shard.index); | ||
| 543 | - } | ||
| 539 | + validateInteger(shard.index, 'options.shard.index', 1, shard.total); | ||
| 544 | 540 | ||
| 545 | 541 | if (watch) { | |
| 546 | 542 | throw new ERR_INVALID_ARG_VALUE('options.shard', watch, 'shards not supported with watch mode'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -239,7 +239,7 @@ const testFixtures = fixtures.path('test-runner'); | |||
| 239 | 239 | ||
| 240 | 240 | assert.strictEqual(child.status, 1); | |
| 241 | 241 | assert.strictEqual(child.signal, null); | |
| 242 | - 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/); | ||
| 242 | + assert.match(child.stderr.toString(), /The value of "options\.shard\.index" is out of range\. It must be >= 1 && <= 3\. Received 0/); | ||
| 243 | 243 | const stdout = child.stdout.toString(); | |
| 244 | 244 | assert.strictEqual(stdout, ''); | |
| 245 | 245 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -350,8 +350,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 350 | 350 | }), { | |
| 351 | 351 | name: 'RangeError', | |
| 352 | 352 | code: 'ERR_OUT_OF_RANGE', | |
| 353 | - // eslint-disable-next-line @stylistic/js/max-len | ||
| 354 | - message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6 ("options.shard.total"). Received 0' | ||
| 353 | + message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6. Received 0' | ||
| 355 | 354 | }); | |
| 356 | 355 | }); | |
| 357 | 356 | ||
@@ -365,8 +364,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 365 | 364 | }), { | |
| 366 | 365 | name: 'RangeError', | |
| 367 | 366 | code: 'ERR_OUT_OF_RANGE', | |
| 368 | - // eslint-disable-next-line @stylistic/js/max-len | ||
| 369 | - message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6 ("options.shard.total"). Received 7' | ||
| 367 | + message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6. Received 7' | ||
| 370 | 368 | }); | |
| 371 | 369 | }); | |
| 372 | 370 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments