Skip to content

Commit 2591638

Browse files
authored
test: validate promise-version setTimeout behavior with NaN
PR-URL: #53622 Refs: #46678 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ea837a0 commit 2591638

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
const { setTimeout } = require('timers/promises');
6+
7+
process.once('warning', common.mustCall((warning) => {
8+
assert.strictEqual(warning.name, 'TimeoutNaNWarning');
9+
}));
10+
11+
setTimeout(NaN).then(common.mustCall(), common.mustNotCall());

0 commit comments

Comments
 (0)