@@ -21,10 +21,6 @@ function getExecutionOrder(bundle) {
21
21
return JSON . parse ( order ) ;
22
22
}
23
23
24
- function clean ( content ) {
25
- return content . replace ( / " \/ .* \/ a s s e t - p i p e - j s - r e a d e r \/ / g, '"/' ) ;
26
- }
27
-
28
24
beforeEach ( ( ) => {
29
25
jest . setTimeout ( 10000 ) ;
30
26
return remove ( FOLDER ) ;
@@ -42,7 +38,7 @@ test('source maps as an option', async () => {
42
38
sourceMaps : true ,
43
39
} ) ;
44
40
45
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
41
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
46
42
} ) ;
47
43
48
44
test ( 'minification with uglify as an option' , async ( ) => {
@@ -56,7 +52,7 @@ test('minification with uglify as an option', async () => {
56
52
minify : true ,
57
53
} ) ;
58
54
59
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
55
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
60
56
} ) ;
61
57
62
58
test ( 'minification with uglify and sourceMaps as options' , async ( ) => {
@@ -71,7 +67,7 @@ test('minification with uglify and sourceMaps as options', async () => {
71
67
sourceMaps : true ,
72
68
} ) ;
73
69
74
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
70
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
75
71
} ) ;
76
72
77
73
test ( 'should successfully bundle 2 feeds' , async ( ) => {
@@ -84,7 +80,7 @@ test('should successfully bundle 2 feeds', async () => {
84
80
directory : FOLDER ,
85
81
} ) ;
86
82
87
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
83
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
88
84
} ) ;
89
85
90
86
test ( 'should successfully bundle 2 feeds when temp directory is used' , async ( ) => {
@@ -95,7 +91,7 @@ test('should successfully bundle 2 feeds when temp directory is used', async ()
95
91
96
92
const content = await bundleJS ( [ feedA , feedB ] ) ;
97
93
98
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
94
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
99
95
} ) ;
100
96
101
97
test ( 'should dedupe' , async ( ) => {
@@ -108,7 +104,7 @@ test('should dedupe', async () => {
108
104
directory : FOLDER ,
109
105
} ) ;
110
106
111
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
107
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
112
108
} ) ;
113
109
114
110
test ( 'should handle node_modules dependencies' , async ( ) => {
@@ -121,7 +117,7 @@ test('should handle node_modules dependencies', async () => {
121
117
const content = await bundleJS ( [ feedA , feedB , feedC ] , {
122
118
directory : FOLDER ,
123
119
} ) ;
124
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
120
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
125
121
} ) ;
126
122
127
123
test ( 'should concat 3 files' , async ( ) => {
@@ -138,7 +134,7 @@ test('should concat 3 files', async () => {
138
134
139
135
expect ( executionOrder ) . toHaveLength ( 3 ) ;
140
136
expect ( executionOrder ) . toEqual ( [ 10 , 4 , 19 ] ) ;
141
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
137
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
142
138
} ) ;
143
139
144
140
test ( 'should concat 2 files' , async ( ) => {
@@ -155,7 +151,7 @@ test('should concat 2 files', async () => {
155
151
156
152
expect ( executionOrder ) . toHaveLength ( 2 ) ;
157
153
expect ( executionOrder ) . toEqual ( [ 3 , 9 ] ) ;
158
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
154
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
159
155
} ) ;
160
156
161
157
test ( 'should concat 1 file' , async ( ) => {
@@ -171,7 +167,7 @@ test('should concat 1 file', async () => {
171
167
172
168
expect ( executionOrder ) . toHaveLength ( 1 ) ;
173
169
expect ( executionOrder ) . toEqual ( [ 3 ] ) ;
174
- expect ( clean ( prettier . format ( content ) ) ) . toMatchSnapshot ( ) ;
170
+ expect ( prettier . format ( content ) ) . toMatchSnapshot ( ) ;
175
171
} ) ;
176
172
177
173
test ( 'code reaches single entry point' , async ( ) => {
@@ -284,7 +280,7 @@ test('code reaches 3 entry points', async () => {
284
280
const spy = jest . fn ( ) ;
285
281
vm . runInNewContext ( result , { spy } ) ;
286
282
287
- expect ( clean ( prettier . format ( result ) ) ) . toMatchSnapshot ( ) ;
283
+ expect ( prettier . format ( result ) ) . toMatchSnapshot ( ) ;
288
284
expect ( spy ) . toHaveBeenCalledTimes ( 3 ) ;
289
285
expect ( spy ) . toMatchSnapshot ( ) ;
290
286
} ) ;
@@ -330,7 +326,7 @@ test('bundling dedupes common modules', async () => {
330
326
const spy = jest . fn ( ) ;
331
327
vm . runInNewContext ( result , { spy } ) ;
332
328
333
- expect ( clean ( prettier . format ( result ) ) ) . toMatchSnapshot ( ) ;
329
+ expect ( prettier . format ( result ) ) . toMatchSnapshot ( ) ;
334
330
expect ( spy ) . toMatchSnapshot ( ) ;
335
331
expect ( spy ) . toHaveBeenCalledTimes ( 4 ) ;
336
332
} ) ;
@@ -376,7 +372,7 @@ test('minified code runs as expected', async () => {
376
372
) ;
377
373
const spy = jest . fn ( ) ;
378
374
vm . runInNewContext ( result , { spy } ) ;
379
- expect ( clean ( prettier . format ( result ) ) ) . toMatchSnapshot ( ) ;
375
+ expect ( prettier . format ( result ) ) . toMatchSnapshot ( ) ;
380
376
expect ( spy ) . toMatchSnapshot ( ) ;
381
377
expect ( spy ) . toHaveBeenCalledTimes ( 4 ) ;
382
378
} ) ;
@@ -424,7 +420,7 @@ test('multiple entrypoints in same feed supported', async () => {
424
420
const spy = jest . fn ( ) ;
425
421
vm . runInNewContext ( result , { spy } ) ;
426
422
427
- expect ( clean ( prettier . format ( result ) ) ) . toMatchSnapshot ( ) ;
423
+ expect ( prettier . format ( result ) ) . toMatchSnapshot ( ) ;
428
424
expect ( spy ) . toMatchSnapshot ( ) ;
429
425
expect ( spy ) . toHaveBeenCalledTimes ( 4 ) ;
430
426
} ) ;
0 commit comments