| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e26166f commit 07c601e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,7 +41,6 @@ const { | |||
| 41 | 41 | codes: { | |
| 42 | 42 | ERR_INVALID_ARG_TYPE, | |
| 43 | 43 | ERR_INVALID_ARG_VALUE, | |
| 44 | - ERR_OUT_OF_RANGE, | ||
| 45 | 44 | ERR_TEST_FAILURE, | |
| 46 | 45 | }, | |
| 47 | 46 | } = require('internal/errors'); | |
@@ -495,11 +494,7 @@ function run(options = kEmptyObject) { | |||
| 495 | 494 | shard = { __proto__: null, index: shard.index, total: shard.total }; | |
| 496 | 495 | ||
| 497 | 496 | validateInteger(shard.total, 'options.shard.total', 1); | |
| 498 | - validateInteger(shard.index, 'options.shard.index'); | ||
| 499 | - | ||
| 500 | - if (shard.index <= 0 || shard.total < shard.index) { | ||
| 501 | - throw new ERR_OUT_OF_RANGE('options.shard.index', `>= 1 && <= ${shard.total} ("options.shard.total")`, shard.index); | ||
| 502 | - } | ||
| 497 | + validateInteger(shard.index, 'options.shard.index', 1, shard.total); | ||
| 503 | 498 | ||
| 504 | 499 | if (watch) { | |
| 505 | 500 | 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 | |
|---|---|---|---|
@@ -238,7 +238,7 @@ const testFixtures = fixtures.path('test-runner'); | |||
| 238 | 238 | ||
| 239 | 239 | assert.strictEqual(child.status, 1); | |
| 240 | 240 | 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/); | ||
| 242 | 242 | const stdout = child.stdout.toString(); | |
| 243 | 243 | assert.strictEqual(stdout, ''); | |
| 244 | 244 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -345,8 +345,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 345 | 345 | }), { | |
| 346 | 346 | name: 'RangeError', | |
| 347 | 347 | code: 'ERR_OUT_OF_RANGE', | |
| 348 | - // eslint-disable-next-line @stylistic/js/max-len | ||
| 349 | - message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6 ("options.shard.total"). Received 0' | ||
| 348 | + message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6. Received 0' | ||
| 350 | 349 | }); | |
| 351 | 350 | }); | |
| 352 | 351 | ||
@@ -360,8 +359,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 360 | 359 | }), { | |
| 361 | 360 | name: 'RangeError', | |
| 362 | 361 | code: 'ERR_OUT_OF_RANGE', | |
| 363 | - // eslint-disable-next-line @stylistic/js/max-len | ||
| 364 | - message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6 ("options.shard.total"). Received 7' | ||
| 362 | + message: 'The value of "options.shard.index" is out of range. It must be >= 1 && <= 6. Received 7' | ||
| 365 | 363 | }); | |
| 366 | 364 | }); | |
| 367 | 365 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments