test: replace forEach() with for ... of in test-http2-single-headers.js
PR-URL: https://github.com/nodejs/node/pull/50606 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
9223820d0e
commit
2c4bb21b8c
@ -27,7 +27,7 @@ server.on('stream', common.mustNotCall());
|
|||||||
server.listen(0, common.mustCall(() => {
|
server.listen(0, common.mustCall(() => {
|
||||||
const client = http2.connect(`http://localhost:${server.address().port}`);
|
const client = http2.connect(`http://localhost:${server.address().port}`);
|
||||||
|
|
||||||
singles.forEach((i) => {
|
for (const i of singles) {
|
||||||
assert.throws(
|
assert.throws(
|
||||||
() => client.request({ [i]: 'abc', [i.toUpperCase()]: 'xyz' }),
|
() => client.request({ [i]: 'abc', [i.toUpperCase()]: 'xyz' }),
|
||||||
{
|
{
|
||||||
@ -45,7 +45,7 @@ server.listen(0, common.mustCall(() => {
|
|||||||
message: `Header field "${i}" must only have a single value`
|
message: `Header field "${i}" must only have a single value`
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
}
|
||||||
|
|
||||||
server.close();
|
server.close();
|
||||||
client.close();
|
client.close();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user