From f8c3e258fdaf2961425455e09a19c7dd3ed3fa05 Mon Sep 17 00:00:00 2001 From: razvanbh Date: Wed, 7 Nov 2018 13:08:27 +0200 Subject: 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(+) (limited to 'test/sequential') diff --git a/test/sequential/test-inspector-module.js b/test/sequential/test-inspector-module.js index eaecd49c98..26bb7fe926 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(), { -- cgit v1.2.3