test: replace forEach with for..of in test-http2-server

PR-URL: https://github.com/nodejs/node/pull/49819
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Niya Shiyas 2023-09-23 13:53:37 +05:30 committed by Luigi Pinca
parent fd562efcfe
commit 63e9d0282d

View File

@ -19,7 +19,7 @@ const types = [
server.on('stream', common.mustCall((stream) => {
const session = stream.session;
types.forEach((input) => {
for (const input of types) {
const received = common.invalidArgTypeHelper(input);
assert.throws(
() => session.goaway(input),
@ -48,7 +48,7 @@ server.on('stream', common.mustCall((stream) => {
`TypedArray, or DataView.${received}`
}
);
});
}
stream.session.destroy();
}));