@@ -6,7 +6,7 @@ const fs = require("fs");
6
6
const webpack = require ( ".." ) ;
7
7
const prettyFormat = require ( "pretty-format" ) ;
8
8
9
- const CWD_PATTERN = new RegExp ( ` ${ process . cwd ( ) } ` . replace ( / \/ | \\ / , "/" ) , "gm" ) ;
9
+ const CWD_PATTERN = new RegExp ( process . cwd ( ) . replace ( / \\ / g , "/" ) , "gm" ) ;
10
10
const ERROR_STACK_PATTERN = / (?: \n \s + a t [ ^ ( ) ] + \( ? .* \) ? ) + / gm;
11
11
12
12
function cleanError ( err ) {
@@ -63,17 +63,13 @@ const prettyFormatOptions = {
63
63
return typeof val === "string" ;
64
64
} ,
65
65
print ( val ) {
66
- return `"${ val . replace ( / \n / gm, "\\n" ) . replace ( / " / gm, '\\"' ) } "` ;
66
+ return `"${ val
67
+ . replace ( / \\ / gm, "/" )
68
+ . replace ( / " / gm, '\\"' )
69
+ . replace ( / \n / gm, "\\n" )
70
+ } "`;
67
71
}
68
- } ,
69
- // {
70
- // test(val) {
71
- // return typeof val === "object" && typeof val.loc !== "undefined";
72
- // },
73
- // print(val) {
74
- // return `"${val.replace(/\n/gm, "\\n").replace(/"/gm, '\\"')}"`;
75
- // }
76
- // }
72
+ }
77
73
]
78
74
} ;
79
75
@@ -100,7 +96,7 @@ expect.addSnapshotSerializer({
100
96
101
97
const defaults = {
102
98
options : {
103
- context : path . resolve ( __dirname , "fixtures/ errors" ) ,
99
+ context : path . resolve ( __dirname , "fixtures" , " errors") ,
104
100
mode : "none" ,
105
101
devtool : false ,
106
102
optimization : {
@@ -242,7 +238,7 @@ Object {
242
238
} ) ;
243
239
244
240
const isCasePreservedFilesystem = fs . existsSync (
245
- path . resolve ( __dirname , "fixtures/ errors/ FILE.js" )
241
+ path . resolve ( __dirname , "fixtures" , " errors" , " FILE.js")
246
242
) ;
247
243
if ( isCasePreservedFilesystem ) {
248
244
it ( "should emit warning for case-preserved disk" , async ( ) => {
0 commit comments