Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: improve test coverage in test-event-capture-rejections.js
Signed-off-by: Juan José Arboleda <[email protected]>
  • Loading branch information
juanarbol committed Oct 24, 2022
commit d3cc9c1dbd40f4158b2f08fea9f3a23076064e65
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