From e9080a94d3af381613be5f299af298d297151318 Mon Sep 17 00:00:00 2001 From: lucacapocci94-dev <82463600+lucacapocci94-dev@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:57:13 +0100 Subject: [PATCH] test: replace foreach with for of PR-URL: https://github.com/nodejs/node/pull/50790 Reviewed-By: James M Snell Reviewed-By: Marco Ippolito Reviewed-By: Luigi Pinca --- test/parallel/test-stream2-transform.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-stream2-transform.js b/test/parallel/test-stream2-transform.js index 6f57384eb02443..2636484ef4509f 100644 --- a/test/parallel/test-stream2-transform.js +++ b/test/parallel/test-stream2-transform.js @@ -413,11 +413,11 @@ const { PassThrough, Transform } = require('stream'); ended = true; }); - objects.forEach(function(obj) { + for (const obj of objects) { jp.write(JSON.stringify(obj)); const res = jp.read(); assert.deepStrictEqual(res, obj); - }); + } jp.end(); // Read one more time to get the 'end' event @@ -454,11 +454,11 @@ const { PassThrough, Transform } = require('stream'); ended = true; }); - objects.forEach(function(obj) { + for (const obj of objects) { js.write(obj); const res = js.read(); assert.strictEqual(res, JSON.stringify(obj)); - }); + } js.end(); // Read one more time to get the 'end' event