Skip to content

Commit

Permalink
test: add test to fs/promises setImmediate
Browse files Browse the repository at this point in the history
Add test pattern to setImmediate when ref's type is not boolean

PR-URL: #35852
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
tyankatsu0105 authored and targos committed Nov 3, 2020
1 parent 644c416 commit 66ad4be
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/parallel/test-timers-promisified.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ process.on('multipleResolves', common.mustNotCall());
code: 'ERR_INVALID_ARG_TYPE'
})).then(common.mustCall());

Promise.all(
[1, '', Infinity, null, {}].map(
(ref) => assert.rejects(setImmediate(10, { ref })), {
code: 'ERR_INVALID_ARG_TYPE'
})).then(common.mustCall());

Promise.all(
[1, '', false, Infinity].map(
(i) => assert.rejects(setTimeout(10, null, i)), {
Expand Down

0 comments on commit 66ad4be

Please sign in to comment.