Skip to content

Commit

Permalink
test: validate promise-version setTimeout behavior with NaN
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
benjamingr authored Jul 22, 2024
1 parent ea837a0 commit 2591638
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/parallel/test-timers-nan-duration-warning-promises.js
Original file line number Diff line number Diff line change
@@ -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());

0 comments on commit 2591638

Please sign in to comment.