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 Ulises Gascón committed 2023-12-11 11:12:24 +00:00
1 parent 9dc63c56db
commit f885dfe5e3
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);
}));