Skip to content

Commit 9bfd84c

Browse files
andp97RafaelGSS
authored andcommitted
test: replace forEach with for of in test-trace-events-api.js
PR-URL: #50784 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent c87e5d5 commit 9bfd84c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎test/parallel/test-trace-events-api.js‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const isChild = process.argv[2] === 'child'
3131
constenabledCategories=getEnabledCategoriesFromCommandLine();
3232

3333
assert.strictEqual(getEnabledCategories(),enabledCategories);
34-
[1,'foo',true,false,null,undefined].forEach((i)=>{
34+
for(constiof[1,'foo',true,false,null,undefined]){
3535
assert.throws(()=>createTracing(i),{
3636
code: 'ERR_INVALID_ARG_TYPE',
3737
name: 'TypeError'
@@ -40,7 +40,7 @@ assert.strictEqual(getEnabledCategories(), enabledCategories);
4040
code: 'ERR_INVALID_ARG_TYPE',
4141
name: 'TypeError'
4242
});
43-
});
43+
}
4444

4545
assert.throws(
4646
()=>createTracing({categories: []}),
@@ -156,8 +156,7 @@ function testApiInChildProcess(execArgs, cb){
156156
assert.strictEqual(
157157
traces.length,
158158
expectedBegins.length+expectedEnds.length);
159-
160-
traces.forEach((trace)=>{
159+
for(consttraceoftraces){
161160
assert.strictEqual(trace.pid,proc.pid);
162161
switch(trace.ph){
163162
case'b': {
@@ -175,7 +174,7 @@ function testApiInChildProcess(execArgs, cb){
175174
default:
176175
assert.fail('Unexpected trace event phase');
177176
}
178-
});
177+
}
179178
process.chdir(parentDir);
180179
cb&&process.nextTick(cb);
181180
}));

0 commit comments

Comments
(0)