Skip to content

Commit ec02fe8

Browse files
committed
fix(oxlint): normalize path separators in snapshot tests (#14406)
Passing CI: https://github.com/oxc-project/oxc/actions/runs/18308879096/job/52132542984
1 parent 46a88f1 commit ec02fe8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/oxlint/test/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ function normalizeStdout(stdout: string): string {
9292
match = line.match(/^(\s*\|\s+File path: )(.+)$/);
9393
if (match) {
9494
const [, preamble, path] = match;
95-
if (path.startsWith(REPO_ROOT_PATH)) return [`${preamble}<root>/${path.slice(REPO_ROOT_PATH.length)}`];
95+
if (path.startsWith(REPO_ROOT_PATH)) {
96+
return [`${preamble}<root>/${path.slice(REPO_ROOT_PATH.length).replace(/\\/g, '/')}`];
97+
}
9698
}
9799
}
98-
if (line.startsWith(REPO_ROOT_PATH)) line = `<root>/${line.slice(REPO_ROOT_PATH.length)}`;
100+
if (line.startsWith(REPO_ROOT_PATH)) line = `<root>/${line.slice(REPO_ROOT_PATH.length).replace(/\\/g, '/')}`;
99101
return [line];
100102
});
101103

0 commit comments

Comments
 (0)