From 4a69d218b6a255480e1656d1b7b4dccf3ba63cd6 Mon Sep 17 00:00:00 2001 From: razvanbh Date: Wed, 7 Nov 2018 13:08:27 +0200 Subject: [PATCH] test: add test for 'ERR_INVALID_CALLBACK' PR-URL: https://github.com/nodejs/node/pull/24224 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater --- test/sequential/test-inspector-module.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/sequential/test-inspector-module.js b/test/sequential/test-inspector-module.js index eaecd49c982311..26bb7fe9262889 100644 --- a/test/sequential/test-inspector-module.js +++ b/test/sequential/test-inspector-module.js @@ -46,6 +46,17 @@ session.post('Runtime.evaluate', { expression: '2 + 2' }); ); }); +[1, 'a', {}, [], true, Infinity].forEach((i) => { + common.expectsError( + () => session.post('test', {}, i), + { + code: 'ERR_INVALID_CALLBACK', + type: TypeError, + message: 'Callback must be a function' + } + ); +}); + common.expectsError( () => session.connect(), {