From 90833a89a947e2f4a2d663308f193f8bc1df971e Mon Sep 17 00:00:00 2001 From: Ram Date: Fri, 22 Sep 2023 18:29:42 -0400 Subject: [PATCH] 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 --- test/parallel/test-dgram-socket-buffer-size.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-dgram-socket-buffer-size.js b/test/parallel/test-dgram-socket-buffer-size.js index c03b8bf48b0221..fcc492a958215c 100644 --- a/test/parallel/test-dgram-socket-buffer-size.js +++ b/test/parallel/test-dgram-socket-buffer-size.js @@ -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(); })); }