GeezerVison is showing github.com — test: replace `forEach()` in `test-stream-pipe-unpipe-stream` · nodejs/node@cd00cdc
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipe-unpipe-streams.js +4-5Lines changed: 4 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -45,13 +45,12 @@ assert.strictEqual(source._readableState.pipes.length, 0); |
45 | 45 | const checkSrcCleanup = common.mustCall(() => { |
46 | 46 | assert.strictEqual(source._readableState.pipes.length, 0); |
47 | 47 | assert.strictEqual(source._readableState.flowing, false); |
48 | | - |
49 | | - srcCheckEventNames.forEach((eventName) => { |
| 48 | + for (const eventName of srcCheckEventNames) { |
50 | 49 | assert.strictEqual( |
51 | 50 | source.listenerCount(eventName), 0, |
52 | 51 | `source's '${eventName}' event listeners not removed` |
53 | 52 | ); |
54 | | - }); |
| 53 | + } |
55 | 54 | }); |
56 | 55 |
|
57 | 56 | function checkDestCleanup(dest) { |
@@ -65,13 +64,13 @@ assert.strictEqual(source._readableState.pipes.length, 0); |
65 | 64 | 'listener which is `unpipeChecker`' |
66 | 65 | ); |
67 | 66 | dest.removeListener('unpipe', unpipeChecker); |
68 | | - destCheckEventNames.forEach((eventName) => { |
| 67 | + for (const eventName of destCheckEventNames) { |
69 | 68 | assert.strictEqual( |
70 | 69 | dest.listenerCount(eventName), 0, |
71 | 70 | `destination{${currentDestId}}'s '${eventName}' event ` + |
72 | 71 | 'listeners not removed' |
73 | 72 | ); |
74 | | - }); |
| 73 | + } |
75 | 74 |
|
76 | 75 | if (--destCount === 0) |
77 | 76 | checkSrcCleanup(); |
|