Skip to content

Commit

Permalink
test: replace forEach with for of in file test-trace-events-net.js
Browse files Browse the repository at this point in the history
PR-URL: #50789
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
Ianna83 authored and richardlau committed Mar 25, 2024
1 parent 55c423b commit c3c2b2b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/parallel/test-trace-events-net.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ proc.once('exit', common.mustCall(() => {
const traces = JSON.parse(data.toString()).traceEvents;
assert(traces.length > 0);
let count = 0;
traces.forEach((trace) => {
if (trace.cat === 'node,node.net,node.net.native' &&
trace.name === 'connect') {
for (const trace of traces) {
if (trace.cat === 'node,node.net,node.net.native' && trace.name === 'connect') {
count++;
}
});
}
// Two begin, two end
assert.strictEqual(count, 4);
}));
Expand Down

0 comments on commit c3c2b2b

Please sign in to comment.