From 84bef02b81aedf786f60284e210bf71b17831894 Mon Sep 17 00:00:00 2001 From: Keita Akutsu Date: Tue, 12 Dec 2017 01:59:54 +0900 Subject: [PATCH] test: add test cases for util.promisify --- test/parallel/test-util-promisify.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/parallel/test-util-promisify.js b/test/parallel/test-util-promisify.js index 656d6d60aa8f13..ed1f94f1a5e38b 100644 --- a/test/parallel/test-util-promisify.js +++ b/test/parallel/test-util-promisify.js @@ -34,6 +34,20 @@ const stat = promisify(fs.stat); assert.strictEqual(promisify(promisify(fn)), promisifedFn); } +{ + common.expectsError( + () => promisify(undefined), + { code: 'ERR_INVALID_ARG_TYPE', type: TypeError } + ); +} + +{ + common.expectsError( + () => promisify(null), + { code: 'ERR_INVALID_ARG_TYPE', type: TypeError } + ); +} + { function fn() {} fn[promisify.custom] = 42;