test: replace forEach() with for...of in test-trace-events-http

PR-URL: https://github.com/nodejs/node/pull/49795
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Chand authored and Luigi Pinca committed 2023-11-02 19:43:42 +01:00
1 parent 45f5c9ba4e
commit 791611a997
1 file changed
+2 -2
+2 -2
View File
@@ -31,12 +31,12 @@ proc.once('exit', common.mustCall(() => {
const traces = JSON.parse(data.toString()).traceEvents;
assert(traces.length > 0);
let count = 0;
traces.forEach((trace) => {
for (const trace of traces) {
if (trace.cat === 'node,node.http' &&
['http.server.request', 'http.client.request'].includes(trace.name)) {
count++;
}
});
}
// Two begin, two end
assert.strictEqual(count, 4);
}));