test: replace forEach() with for...of

Replace `forEach()` with `for...of` in in test-dgram-socket-buffer-size.

PR-URL: https://github.com/nodejs/node/pull/49794
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Ram authored and Luigi Pinca committed 2023-11-02 19:47:11 +01:00
1 parent 791611a997
commit 196224cb29
1 file changed
+2 -3
@@ -93,15 +93,14 @@ function getExpectedError(type) {
const socket = dgram.createSocket('udp4');
socket.bind(common.mustCall(() => {
badBufferSizes.forEach((badBufferSize) => {
for (const badBufferSize of badBufferSizes) {
assert.throws(() => {
socket.setRecvBufferSize(badBufferSize);
}, errorObj);
assert.throws(() => {
socket.setSendBufferSize(badBufferSize);
}, errorObj);
});
}
socket.close();
}));
}