Skip to content

Commit

Permalink
test: use for ... of instead of forEach
Browse files Browse the repository at this point in the history
  • Loading branch information
gibbyfree authored and aduh95 committed May 11, 2024
1 parent 80206a3 commit eec759f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-path-parse-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ const trailingTests = [
],
];
const failures = [];
trailingTests.forEach(([parse, testList]) => {
for (const [parse, testList] of trailingTests) {
const os = parse === path.win32.parse ? 'win32' : 'posix';
testList.forEach(([input, expected]) => {
for (const [input, expected] of testList) {
const actual = parse(input);
const message = `path.${os}.parse(${JSON.stringify(input)})\n expect=${
JSON.stringify(expected)}\n actual=${JSON.stringify(actual)}`;
Expand All @@ -168,8 +168,8 @@ trailingTests.forEach(([parse, testList]) => {
}
if (failed)
failures.push(`\n${message}`);
});
});
}
}
assert.strictEqual(failures.length, 0, failures.join(''));

function checkErrors(path) {
Expand Down

0 comments on commit eec759f

Please sign in to comment.