Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use destructuring in test-path-parse-format #49790

Merged
merged 2 commits into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions test/parallel/test-path-parse-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,11 @@ const trailingTests = [
],
];
const failures = [];
trailingTests.forEach((test) => {
const parse = test[0];
for (const [parse, testList] of trailingTests) {
const os = parse === path.win32.parse ? 'win32' : 'posix';
test[1].forEach((test) => {
const actual = parse(test[0]);
const expected = test[1];
const message = `path.${os}.parse(${JSON.stringify(test[0])})\n expect=${
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)}`;
const actualKeys = Object.keys(actual);
const expectedKeys = Object.keys(expected);
Expand All @@ -170,8 +168,8 @@ trailingTests.forEach((test) => {
}
if (failed)
failures.push(`\n${message}`);
});
});
}
}
assert.strictEqual(failures.length, 0, failures.join(''));

function checkErrors(path) {
Expand Down