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 10f92d1

Browse filesBrowse files
trivikrMylesBorins
authored andcommitted
test: http2 client settings invalid callback
PR-URL: #18850 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent baf1acc commit 10f92d1
Copy full SHA for 10f92d1

File tree

Expand file treeCollapse file tree

1 file changed

+17
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-4
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-http2-client-settings-before-connect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http2-client-settings-before-connect.js
+17-4Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,26 @@ server.listen(0, common.mustCall(() => {
3535
['enablePush', 0, TypeError],
3636
['enablePush', null, TypeError],
3737
['enablePush', {}, TypeError]
38-
].forEach((i) => {
38+
].forEach(([name, value, errorType]) =>
3939
common.expectsError(
40-
() => client.settings({ [i[0]]: i[1] }),
40+
() => client.settings({ [name]: value }),
4141
{
4242
code: 'ERR_HTTP2_INVALID_SETTING_VALUE',
43-
type: i[2] });
44-
});
43+
type: errorType
44+
}
45+
)
46+
);
47+
48+
[1, true, {}, []].forEach((invalidCallback) =>
49+
common.expectsError(
50+
() => client.settings({}, invalidCallback),
51+
{
52+
type: TypeError,
53+
code: 'ERR_INVALID_CALLBACK',
54+
message: 'Callback must be a function'
55+
}
56+
)
57+
);
4558

4659
client.settings({ maxFrameSize: 1234567 });
4760

0 commit comments

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