From c3c2b2b041e825a729c07084bdb2dcb1dafe7b51 Mon Sep 17 00:00:00 2001 From: Ianna83 Date: Sat, 18 Nov 2023 16:52:28 +0100 Subject: [PATCH] test: replace forEach with for of in file test-trace-events-net.js PR-URL: https://github.com/nodejs/node/pull/50789 Reviewed-By: James M Snell Reviewed-By: Marco Ippolito Reviewed-By: Luigi Pinca --- test/parallel/test-trace-events-net.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-trace-events-net.js b/test/parallel/test-trace-events-net.js index c605cb5bd087b6..a1a93b19080b8a 100644 --- a/test/parallel/test-trace-events-net.js +++ b/test/parallel/test-trace-events-net.js @@ -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); }));