test: add test for 'ERR_INVALID_CALLBACK'

PR-URL: https://github.com/nodejs/node/pull/24224
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
razvanbh 2018-11-07 13:08:27 +02:00 committed by Gireesh Punathil
parent b88195716f
commit f8c3e258fd

View File

@ -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( common.expectsError(
() => session.connect(), () => session.connect(),
{ {