mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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:
1 parent
45f5c9ba4e
commit
791611a997
1 file changed
+2
-2
@@ -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);
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user