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:
Benjamin Gruenbaum 2024-07-22 08:52:57 +03:00 committed by GitHub
parent ea837a0db9
commit 259163802c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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());