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