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:
spiritualized authored and GitHub committed 2023-11-11 13:22:16 +00:00
1 parent 9223820d0e
commit 2c4bb21b8c
1 file changed
+2 -2
+2 -2
View File
@@ -27,7 +27,7 @@ server.on('stream', common.mustNotCall());
server.listen(0, common.mustCall(() => {
const client = http2.connect(`http://localhost:${server.address().port}`);
singles.forEach((i) => {
for (const i of singles) {
assert.throws(
() => 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`
}
);
});
}
server.close();
client.close();