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 RafaelGSS committed Jan 2, 2024
1 parent f1cb583 commit 38232d1
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 38232d1

Please sign in to comment.