Skip to content

Commit 800b6f6

Browse files
DevPresmarco-ippolito
authored andcommittedJun 17, 2024
test: replace forEach() in test-stream-pipe-unpipe-stream
PR-URL: #50786 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 9512839 commit 800b6f6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

‎test/parallel/test-stream-pipe-unpipe-streams.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ assert.strictEqual(source._readableState.pipes.length, 0);
4545
const checkSrcCleanup = common.mustCall(() => {
4646
assert.strictEqual(source._readableState.pipes.length, 0);
4747
assert.strictEqual(source._readableState.flowing, false);
48-
49-
srcCheckEventNames.forEach((eventName) => {
48+
for (const eventName of srcCheckEventNames) {
5049
assert.strictEqual(
5150
source.listenerCount(eventName), 0,
5251
`source's '${eventName}' event listeners not removed`
5352
);
54-
});
53+
}
5554
});
5655

5756
function checkDestCleanup(dest) {
@@ -65,13 +64,13 @@ assert.strictEqual(source._readableState.pipes.length, 0);
6564
'listener which is `unpipeChecker`'
6665
);
6766
dest.removeListener('unpipe', unpipeChecker);
68-
destCheckEventNames.forEach((eventName) => {
67+
for (const eventName of destCheckEventNames) {
6968
assert.strictEqual(
7069
dest.listenerCount(eventName), 0,
7170
`destination{${currentDestId}}'s '${eventName}' event ` +
7271
'listeners not removed'
7372
);
74-
});
73+
}
7574

7675
if (--destCount === 0)
7776
checkSrcCleanup();

0 commit comments

Comments
 (0)
Please sign in to comment.