forked from nodejs/node-core-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR-URL: nodejs/node#43843 Reviewed-By: Feng Yu <[email protected]> (cherry picked from commit d83446b4c4694322e12d2b7d22592f2be674e580)
- Loading branch information
Showing
4 changed files
with
48 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict' | ||
|
||
const TIMEOUT_MAX = 2 ** 31 - 1 | ||
|
||
module.exports = { | ||
TIMEOUT_MAX | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// https://github.com/nodejs/node/blob/d83446b4c4694322e12d2b7d22592f2be674e580/test/parallel/test-runner-option-validation.js | ||
|
||
'use strict' | ||
require('../common') | ||
const assert = require('assert') | ||
const test = require('node:test'); | ||
|
||
// eslint-disable-next-line symbol-description | ||
[Symbol(), {}, [], () => {}, 1n, true, '1'].forEach((timeout) => { | ||
assert.throws(() => test({ timeout }), { code: 'ERR_INVALID_ARG_TYPE' }) | ||
}); | ||
[-1, -Infinity, NaN, 2 ** 33, Number.MAX_SAFE_INTEGER].forEach((timeout) => { | ||
assert.throws(() => test({ timeout }), { code: 'ERR_OUT_OF_RANGE' }) | ||
}); | ||
[null, undefined, Infinity, 0, 1, 1.1].forEach((timeout) => { | ||
// Valid values should not throw. | ||
test({ timeout }) | ||
}) |