mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
test: validate promise-version setTimeout
behavior with NaN
PR-URL: https://github.com/nodejs/node/pull/53622 Refs: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
ea837a0db9
commit
259163802c
11
test/parallel/test-timers-nan-duration-warning-promises.js
Normal file
11
test/parallel/test-timers-nan-duration-warning-promises.js
Normal file
@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const { setTimeout } = require('timers/promises');
|
||||
|
||||
process.once('warning', common.mustCall((warning) => {
|
||||
assert.strictEqual(warning.name, 'TimeoutNaNWarning');
|
||||
}));
|
||||
|
||||
setTimeout(NaN).then(common.mustCall(), common.mustNotCall());
|
Loading…
Reference in New Issue
Block a user