Skip to content

Commit

Permalink
test: http2 client settings invalid callback
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
trivikr authored and MylesBorins committed Aug 7, 2018
1 parent 1ce427e commit 3a5dd0c
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions test/parallel/test-http2-client-settings-before-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,26 @@ server.listen(0, common.mustCall(() => {
['enablePush', 0, TypeError],
['enablePush', null, TypeError],
['enablePush', {}, TypeError]
].forEach((i) => {
].forEach(([name, value, errorType]) =>
common.expectsError(
() => client.settings({ [i[0]]: i[1] }),
() => client.settings({ [name]: value }),
{
code: 'ERR_HTTP2_INVALID_SETTING_VALUE',
type: i[2] });
});
type: errorType
}
)
);

[1, true, {}, []].forEach((invalidCallback) =>
common.expectsError(
() => client.settings({}, invalidCallback),
{
type: TypeError,
code: 'ERR_INVALID_CALLBACK',
message: 'callback must be a function'
}
)
);

client.settings({ maxFrameSize: 1234567 });

Expand Down

0 comments on commit 3a5dd0c

Please sign in to comment.