Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
test_runner: validate
timeout option
PR-URL: #43843 Reviewed-By: Feng Yu <F3n67u@outlook.com>
- Loading branch information
1 parent
2266a4b
commit f98020138ab7481c77402f29e086202924e3afec
Showing
3 changed files
with
33 additions
and
3 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
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,15 @@ | ||
| 'use strict'; | ||
| require('../common'); | ||
| const assert = require('assert'); | ||
| const test = require('node:test'); | ||
|
|
||
| [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 }); | ||
| }); |