Skip to content

Commit e9080a9

Browse files
lucacapocci94-devrichardlau
authored andcommitted
test: replace foreach with for of
PR-URL: #50790 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 0022767 commit e9080a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/parallel/test-stream2-transform.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,11 @@ const { PassThrough, Transform } = require('stream');
413413
ended = true;
414414
});
415415

416-
objects.forEach(function(obj) {
416+
for (const obj of objects) {
417417
jp.write(JSON.stringify(obj));
418418
const res = jp.read();
419419
assert.deepStrictEqual(res, obj);
420-
});
420+
}
421421

422422
jp.end();
423423
// Read one more time to get the 'end' event
@@ -454,11 +454,11 @@ const { PassThrough, Transform } = require('stream');
454454
ended = true;
455455
});
456456

457-
objects.forEach(function(obj) {
457+
for (const obj of objects) {
458458
js.write(obj);
459459
const res = js.read();
460460
assert.strictEqual(res, JSON.stringify(obj));
461-
});
461+
}
462462

463463
js.end();
464464
// Read one more time to get the 'end' event

0 commit comments

Comments
 (0)