test: http2 client settings invalid callback
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
1e57a8d117
commit
0089860757
@ -35,13 +35,26 @@ server.listen(0, common.mustCall(() => {
|
|||||||
['enablePush', 0, TypeError],
|
['enablePush', 0, TypeError],
|
||||||
['enablePush', null, TypeError],
|
['enablePush', null, TypeError],
|
||||||
['enablePush', {}, TypeError]
|
['enablePush', {}, TypeError]
|
||||||
].forEach((i) => {
|
].forEach(([name, value, errorType]) =>
|
||||||
common.expectsError(
|
common.expectsError(
|
||||||
() => client.settings({ [i[0]]: i[1] }),
|
() => client.settings({ [name]: value }),
|
||||||
{
|
{
|
||||||
code: 'ERR_HTTP2_INVALID_SETTING_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 });
|
client.settings({ maxFrameSize: 1234567 });
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user