Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eed799b

Browse filesBrowse files
juanarbolRafaelGSS
authored andcommitted
test: improve test coverage in test-event-capture-rejections.js
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com> PR-URL: #45148 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent aa4152a commit eed799b
Copy full SHA for eed799b

File tree

Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-event-capture-rejections.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-event-capture-rejections.js
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ const { inherits } = require('util');
99
function NoConstructor() {
1010
}
1111

12+
// captureRejections param validation
13+
{
14+
[1, [], function() {}, {}, Infinity, Math.PI, 'meow'].forEach((arg) => {
15+
assert.throws(
16+
() => new EventEmitter({ captureRejections: arg }),
17+
{
18+
name: 'TypeError',
19+
code: 'ERR_INVALID_ARG_TYPE',
20+
message: 'The "options.captureRejections" property must be of type boolean.' +
21+
common.invalidArgTypeHelper(arg)
22+
}
23+
);
24+
});
25+
}
26+
1227
inherits(NoConstructor, EventEmitter);
1328

1429
function captureRejections() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.