File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
e2e/plugin-typescript-e2e/tests Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff 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 './ exclude/utils.ts' is not under 'rootDir' './src'. '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" ,
Original file line number Diff line number Diff line change @@ -19,13 +19,18 @@ function sanitizeReportPaths(report: Report): Report {
1919 plugins : report . plugins . map ( plugin => ( {
2020 ...plugin ,
2121 audits : osAgnosticAuditOutputs ( plugin . audits , message =>
22- message . replaceAll ( / [ ' " ] ( [ ^ ' " ] * [ / \\ ] [ ^ ' " ] * ) [ ' " ] / g, ( p : string ) => {
23- const osAgnostic = osAgnosticPath ( p ) ;
24- if ( osAgnostic . endsWith ( '.ts' ) ) {
25- return osAgnostic ;
26- }
27- return osAgnostic . split ( '/' ) . slice ( - 1 ) . join ( '/' ) ;
28- } ) ,
22+ message . replace (
23+ / [ ' " ] ( [ ^ ' " ] * [ / \\ ] [ ^ ' " ] * ) [ ' " ] / g,
24+ ( fullMatch : string , capturedPath : string ) => {
25+ const osAgnostic = osAgnosticPath ( capturedPath ) ;
26+ // Only replace directory paths, not .ts file paths
27+ if ( capturedPath . endsWith ( '.ts' ) ) {
28+ return `'${ osAgnostic } '` ;
29+ }
30+ // on Windows the path starts from "D/" not "./". This normalizes it to "./<segment>"
31+ return `'${ [ '.' ] . concat ( osAgnostic . split ( '/' ) . slice ( - 1 ) ) . join ( '/' ) } '` ;
32+ } ,
33+ ) ,
2934 ) ,
3035 } ) ) ,
3136 } ;
You can’t perform that action at this time.
0 commit comments