Skip to content

Commit 8ac05cf

Browse files
andp97richardlau
authored andcommittedMar 25, 2024
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 721557c commit 8ac05cf

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed
 

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const isChild = process.argv[2] === 'child';
3131
const enabledCategories = getEnabledCategoriesFromCommandLine();
3232

3333
assert.strictEqual(getEnabledCategories(), enabledCategories);
34-
[1, 'foo', true, false, null, undefined].forEach((i) => {
34+
for (const i of [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 (const trace of traces) {
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)
Please sign in to comment.