test: replace forEach with for of

PR-URL: https://github.com/nodejs/node/pull/50602
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
john-mcinall 2023-11-10 17:46:55 +00:00 committed by GitHub
parent 43f5b22526
commit fd4a305464
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,7 +104,7 @@ const testFixtures = fixtures.path('test-runner');
['--print', 'console.log("should not print")', '--test'], ['--print', 'console.log("should not print")', '--test'],
]; ];
flags.forEach((args) => { for (const args of flags) {
const child = spawnSync(process.execPath, args); const child = spawnSync(process.execPath, args);
assert.notStrictEqual(child.status, 0); assert.notStrictEqual(child.status, 0);
@ -112,7 +112,7 @@ const testFixtures = fixtures.path('test-runner');
assert.strictEqual(child.stdout.toString(), ''); assert.strictEqual(child.stdout.toString(), '');
const stderr = child.stderr.toString(); const stderr = child.stderr.toString();
assert.match(stderr, /--test/); assert.match(stderr, /--test/);
}); }
} }
{ {