Skip to content

Commit

Permalink
test: replace foreach with for of
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lucacapocci94-dev authored and RafaelGSS committed Jan 2, 2024
1 parent 115e058 commit ef44f9b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-stream2-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ef44f9b

Please sign in to comment.