Skip to content

Commit

Permalink
test: improve test coverage in test-event-capture-rejections.js
Browse files Browse the repository at this point in the history
Signed-off-by: Juan José Arboleda <[email protected]>
PR-URL: nodejs#45148
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
  • Loading branch information
juanarbol authored Oct 29, 2022
1 parent e512786 commit cca44bc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-event-capture-rejections.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ const { inherits } = require('util');
function NoConstructor() {
}

// captureRejections param validation
{
[1, [], function() {}, {}, Infinity, Math.PI, 'meow'].forEach((arg) => {
assert.throws(
() => new EventEmitter({ captureRejections: arg }),
{
name: 'TypeError',
code: 'ERR_INVALID_ARG_TYPE',
message: 'The "options.captureRejections" property must be of type boolean.' +
common.invalidArgTypeHelper(arg)
}
);
});
}

inherits(NoConstructor, EventEmitter);

function captureRejections() {
Expand Down

0 comments on commit cca44bc

Please sign in to comment.