From 66ad4be2c1f8f2db5459661b8ab8fcb1aa4a8322 Mon Sep 17 00:00:00 2001 From: tyankatsu Date: Wed, 28 Oct 2020 23:18:14 +0900 Subject: [PATCH] test: add test to fs/promises setImmediate Add test pattern to setImmediate when ref's type is not boolean PR-URL: https://github.com/nodejs/node/pull/35852 Reviewed-By: Yosuke Furukawa Reviewed-By: Masashi Hirano Reviewed-By: Benjamin Gruenbaum Reviewed-By: Shingo Inoue Reviewed-By: Daijiro Wachi Reviewed-By: Ricky Zhou <0x19951125@gmail.com> Reviewed-By: Rich Trott --- test/parallel/test-timers-promisified.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/parallel/test-timers-promisified.js b/test/parallel/test-timers-promisified.js index 6cd932a2d169ff..bd52d2166cf88a 100644 --- a/test/parallel/test-timers-promisified.js +++ b/test/parallel/test-timers-promisified.js @@ -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)), {