Skip to content
Closed
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions test/parallel/test-path-join.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,12 @@ joinTests.forEach((test) => {
} else {
os = 'posix';
}
const message =
`path.${os}.join(${test[0].map(JSON.stringify).join(',')})\n expect=${
if (actual !== expected && actualAlt !== expected) {
const delimiter = test[0].map(JSON.stringify).join(',');
const message = `path.${os}.join(${delimiter})\n expect=${
JSON.stringify(expected)}\n actual=${JSON.stringify(actual)}`;
if (actual !== expected && actualAlt !== expected)
failures.push(`\n${message}`);
}
});
});
});
Expand Down
11 changes: 6 additions & 5 deletions test/parallel/test-path-relative.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ relativeTests.forEach((test) => {
test[1].forEach((test) => {
const actual = relative(test[0], test[1]);
const expected = test[2];
const os = relative === path.win32.relative ? 'win32' : 'posix';
const message = `path.${os}.relative(${
test.slice(0, 2).map(JSON.stringify).join(',')})\n expect=${
JSON.stringify(expected)}\n actual=${JSON.stringify(actual)}`;
if (actual !== expected)
if (actual !== expected) {
const os = relative === path.win32.relative ? 'win32' : 'posix';
const message = `path.${os}.relative(${
test.slice(0, 2).map(JSON.stringify).join(',')})\n expect=${
JSON.stringify(expected)}\n actual=${JSON.stringify(actual)}`;
failures.push(`\n${message}`);
}
});
});
assert.strictEqual(failures.length, 0, failures.join(''));