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 <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
lucacapocci94-dev authored Dec 29, 2023
1 parent 1a49193 commit a950d40
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 a950d40

Please sign in to comment.