test: improve coverage for timer promises schedular

PR-URL: https://github.com/nodejs/node/pull/53370
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Aviv Keller 2024-06-06 12:52:10 -04:00 committed by James M Snell
parent 415b82d8b8
commit b23d1c37b9

View File

@ -7,6 +7,7 @@ const { setTimeout } = require('timers');
const {
strictEqual,
rejects,
throws,
} = require('assert');
async function testYield() {
@ -48,3 +49,7 @@ async function testCancelableWait2() {
}
testCancelableWait2().then(common.mustCall());
throws(() => new scheduler.constructor(), {
code: 'ERR_ILLEGAL_CONSTRUCTOR',
});