From 49a0a0c875430943fd889595c2d158c454bb3684 Mon Sep 17 00:00:00 2001 From: Mithun Sasidharan Date: Thu, 14 Dec 2017 21:44:08 +0530 Subject: [PATCH] test: coverage for util.promisify --- test/parallel/test-util-promisify.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/parallel/test-util-promisify.js b/test/parallel/test-util-promisify.js index 656d6d60aa8f13..235d5c40db7677 100644 --- a/test/parallel/test-util-promisify.js +++ b/test/parallel/test-util-promisify.js @@ -184,3 +184,13 @@ const stat = promisify(fs.stat); }) ]); } + +[undefined, null, true, 0, 'str', {}, [], Symbol()].forEach((input) => { + common.expectsError( + () => promisify(input), + { + code: 'ERR_INVALID_ARG_TYPE', + type: TypeError, + message: 'The "original" argument must be of type Function' + }); +});