mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
test: validate ERR_INVALID_THIS for scheduler methods
Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63764 Refs: https://app.codecov.io/gh/nodejs/node/blob/main/lib%2Ftimers%2Fpromises.js Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit is contained in:
1 parent
5e645ccf55
commit
1be74647ca
1 file changed
+14
@@ -49,3 +49,17 @@ testCancelableWait2().then(common.mustCall());
|
||||
assert.throws(() => new scheduler.constructor(), {
|
||||
code: 'ERR_ILLEGAL_CONSTRUCTOR',
|
||||
});
|
||||
|
||||
assert.throws(() => {
|
||||
scheduler.yield.call({});
|
||||
}, {
|
||||
code: 'ERR_INVALID_THIS',
|
||||
message: /Scheduler/,
|
||||
});
|
||||
|
||||
assert.throws(() => {
|
||||
scheduler.wait.call({}, 10);
|
||||
}, {
|
||||
code: 'ERR_INVALID_THIS',
|
||||
message: /Scheduler/,
|
||||
});
|
||||
Reference in new issue
Block a user