Skip to content

Commit 18f397c

Browse files
committed
test(plugin-typescript-e2e): fix path for windows robust variant 3
1 parent f8220d9 commit 18f397c

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

e2e/plugin-typescript-e2e/tests/__snapshots__/collect.e2e.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ exports[`PLUGIN collect report with typescript-plugin NPM package > should run p
121121
"details": {
122122
"issues": [
123123
{
124-
"message": "TS6059: File './exclude/utils.ts' is not under 'rootDir' './src'. 'rootDir' is expected to contain all source files.",
124+
"message": "TS6059: File '<PATH>' is not under 'rootDir' '<PATH>'. 'rootDir' is expected to contain all source files.",
125125
"severity": "error",
126126
"source": {
127127
"file": "tmp/e2e/plugin-typescript-e2e/src/6-configuration-errors.ts",

e2e/plugin-typescript-e2e/tests/collect.e2e.test.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,8 @@ function sanitizeReportPaths(report: Report): Report {
3131
},
3232
}),
3333
message: issue.message.replace(
34-
/['"]([A-Z]:[/\\][^'"]*|[^'"]*[/\\][^'"]*[/\\][^'"]*)['"]/g,
35-
(match, filePath) => {
36-
try {
37-
const lastSegment = filePath.split(/[/\\]/).pop() || '';
38-
return `'<CWD>/${lastSegment}'`;
39-
} catch {
40-
return match;
41-
}
42-
},
34+
/['"]([^'"]*[/\\][^'"]*)['"]/g,
35+
"'<PATH>'",
4336
),
4437
})),
4538
},

0 commit comments

Comments
 (0)