@@ -13,10 +13,9 @@ describe('cache', () => {
13
13
expect ( exitCode ) . toEqual ( 0 ) ;
14
14
15
15
if ( isWebpack5 ) {
16
- expect ( stderr ) . toContain ( "Compilation 'cache-test-default' starting..." ) ;
17
- expect ( stderr ) . toContain ( "Compilation 'cache-test-default' finished" ) ;
18
16
expect ( stderr . match ( / N o p a c k e x i s t s a t / g) ) . toHaveLength ( 1 ) ;
19
17
expect ( stderr . match ( / S t o r e d p a c k / g) ) . toHaveLength ( 1 ) ;
18
+ expect ( stderr ) . toBeTruthy ( ) ;
20
19
expect ( stdout ) . toBeTruthy ( ) ;
21
20
}
22
21
@@ -25,29 +24,27 @@ describe('cache', () => {
25
24
expect ( exitCode ) . toEqual ( 0 ) ;
26
25
27
26
if ( isWebpack5 ) {
28
- expect ( stderr ) . toContain ( "Compilation 'cache-test-default' starting..." ) ;
29
- expect ( stderr ) . toContain ( "Compilation 'cache-test-default' finished" ) ;
30
27
expect ( stderr . match ( / r e s t o r e c a c h e c o n t a i n e r : / g) ) . toHaveLength ( 1 ) ;
31
28
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t m e t a d a t a : / g) ) . toHaveLength ( 1 ) ;
32
29
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t \d + \( .+ \) : / g) ) . toHaveLength ( 1 ) ;
30
+ expect ( stderr ) . toBeTruthy ( ) ;
33
31
expect ( stdout ) . toBeTruthy ( ) ;
34
32
}
35
33
} ) ;
36
34
37
35
it ( 'should work in multi compiler mode' , ( ) => {
38
- rimraf . sync ( path . join ( __dirname , '../../node_modules/.cache/webpack/cache-test-{first,second}-development' ) ) ;
36
+ rimraf . sync ( path . join ( __dirname , '../../node_modules/.cache/webpack/cache-test-first-development' ) ) ;
37
+ rimraf . sync ( path . join ( __dirname , '../../node_modules/.cache/webpack/cache-test-second-development' ) ) ;
39
38
40
39
let { exitCode, stderr, stdout } = run ( __dirname , [ '-c' , './multi.config.js' ] , false ) ;
41
40
42
41
expect ( exitCode ) . toEqual ( 0 ) ;
43
42
44
43
if ( isWebpack5 ) {
45
- expect ( stderr ) . toContain ( "Compilation 'cache-test-first' starting..." ) ;
46
- expect ( stderr ) . toContain ( "Compilation 'cache-test-first' finished" ) ;
47
- expect ( stderr ) . toContain ( "Compilation 'cache-test-second' starting..." ) ;
48
- expect ( stderr ) . toContain ( "Compilation 'cache-test-second' finished" ) ;
44
+ console . log ( stderr ) ;
49
45
expect ( stderr . match ( / N o p a c k e x i s t s a t / g) ) . toHaveLength ( 2 ) ;
50
46
expect ( stderr . match ( / S t o r e d p a c k / g) ) . toHaveLength ( 2 ) ;
47
+ expect ( stderr ) . toBeTruthy ( ) ;
51
48
expect ( stdout ) . toBeTruthy ( ) ;
52
49
}
53
50
@@ -56,13 +53,10 @@ describe('cache', () => {
56
53
expect ( exitCode ) . toEqual ( 0 ) ;
57
54
58
55
if ( isWebpack5 ) {
59
- expect ( stderr ) . toContain ( "Compilation 'cache-test-first' starting..." ) ;
60
- expect ( stderr ) . toContain ( "Compilation 'cache-test-first' finished" ) ;
61
- expect ( stderr ) . toContain ( "Compilation 'cache-test-second' starting..." ) ;
62
- expect ( stderr ) . toContain ( "Compilation 'cache-test-second' finished" ) ;
63
56
expect ( stderr . match ( / r e s t o r e c a c h e c o n t a i n e r : / g) ) . toHaveLength ( 2 ) ;
64
57
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t m e t a d a t a : / g) ) . toHaveLength ( 2 ) ;
65
58
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t \d + \( .+ \) : / g) ) . toHaveLength ( 2 ) ;
59
+ expect ( stderr ) . toBeTruthy ( ) ;
66
60
expect ( stdout ) . toBeTruthy ( ) ;
67
61
}
68
62
} ) ;
@@ -79,10 +73,9 @@ describe('cache', () => {
79
73
expect ( exitCode ) . toEqual ( 0 ) ;
80
74
81
75
if ( isWebpack5 ) {
82
- expect ( stderr ) . toContain ( "Compilation 'cache-test-third' starting..." ) ;
83
- expect ( stderr ) . toContain ( "Compilation 'cache-test-third' finished" ) ;
84
76
expect ( stderr . match ( / N o p a c k e x i s t s a t / g) ) . toHaveLength ( 1 ) ;
85
77
expect ( stderr . match ( / S t o r e d p a c k / g) ) . toHaveLength ( 1 ) ;
78
+ expect ( stderr ) . toBeTruthy ( ) ;
86
79
expect ( stdout ) . toBeTruthy ( ) ;
87
80
}
88
81
@@ -95,11 +88,10 @@ describe('cache', () => {
95
88
expect ( exitCode ) . toEqual ( 0 ) ;
96
89
97
90
if ( isWebpack5 ) {
98
- expect ( stderr ) . toContain ( "Compilation 'cache-test-third' starting..." ) ;
99
- expect ( stderr ) . toContain ( "Compilation 'cache-test-third' finished" ) ;
100
91
expect ( stderr . match ( / r e s t o r e c a c h e c o n t a i n e r : / g) ) . toHaveLength ( 1 ) ;
101
92
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t m e t a d a t a : / g) ) . toHaveLength ( 1 ) ;
102
93
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t \d + \( .+ \) : / g) ) . toHaveLength ( 1 ) ;
94
+ expect ( stderr ) . toBeTruthy ( ) ;
103
95
expect ( stdout ) . toBeTruthy ( ) ;
104
96
}
105
97
} ) ;
@@ -116,10 +108,9 @@ describe('cache', () => {
116
108
expect ( exitCode ) . toEqual ( 0 ) ;
117
109
118
110
if ( isWebpack5 ) {
119
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fourth' starting..." ) ;
120
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fourth' finished" ) ;
121
111
expect ( stderr . match ( / N o p a c k e x i s t s a t / g) ) . toHaveLength ( 1 ) ;
122
112
expect ( stderr . match ( / S t o r e d p a c k / g) ) . toHaveLength ( 1 ) ;
113
+ expect ( stderr ) . toBeTruthy ( ) ;
123
114
expect ( stdout ) . toBeTruthy ( ) ;
124
115
}
125
116
@@ -132,11 +123,10 @@ describe('cache', () => {
132
123
expect ( exitCode ) . toEqual ( 0 ) ;
133
124
134
125
if ( isWebpack5 ) {
135
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fourth' starting..." ) ;
136
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fourth' finished" ) ;
137
126
expect ( stderr . match ( / r e s t o r e c a c h e c o n t a i n e r : / g) ) . toHaveLength ( 1 ) ;
138
127
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t m e t a d a t a : / g) ) . toHaveLength ( 1 ) ;
139
128
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t \d + \( .+ \) : / g) ) . toHaveLength ( 1 ) ;
129
+ expect ( stderr ) . toBeTruthy ( ) ;
140
130
expect ( stdout ) . toBeTruthy ( ) ;
141
131
}
142
132
} ) ;
@@ -165,10 +155,9 @@ describe('cache', () => {
165
155
expect ( exitCode ) . toEqual ( 0 ) ;
166
156
167
157
if ( isWebpack5 ) {
168
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fifth' starting..." ) ;
169
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fifth' finished" ) ;
170
158
expect ( stderr . match ( / N o p a c k e x i s t s a t / g) ) . toHaveLength ( 1 ) ;
171
159
expect ( stderr . match ( / S t o r e d p a c k / g) ) . toHaveLength ( 1 ) ;
160
+ expect ( stderr ) . toBeTruthy ( ) ;
172
161
expect ( stdout ) . toBeTruthy ( ) ;
173
162
}
174
163
@@ -193,11 +182,10 @@ describe('cache', () => {
193
182
expect ( exitCode ) . toEqual ( 0 ) ;
194
183
195
184
if ( isWebpack5 ) {
196
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fifth' starting..." ) ;
197
- expect ( stderr ) . toContain ( "Compilation 'cache-test-fifth' finished" ) ;
198
185
expect ( stderr . match ( / r e s t o r e c a c h e c o n t a i n e r : / g) ) . toHaveLength ( 1 ) ;
199
186
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t m e t a d a t a : / g) ) . toHaveLength ( 1 ) ;
200
187
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t \d + \( .+ \) : / g) ) . toHaveLength ( 1 ) ;
188
+ expect ( stderr ) . toBeTruthy ( ) ;
201
189
expect ( stdout ) . toBeTruthy ( ) ;
202
190
}
203
191
} ) ;
@@ -210,10 +198,9 @@ describe('cache', () => {
210
198
expect ( exitCode ) . toEqual ( 0 ) ;
211
199
212
200
if ( isWebpack5 ) {
213
- expect ( stderr ) . toContain ( "Compilation 'cache-test-autoloading' starting..." ) ;
214
- expect ( stderr ) . toContain ( "Compilation 'cache-test-autoloading' finished" ) ;
215
201
expect ( stderr . match ( / N o p a c k e x i s t s a t / g) ) . toHaveLength ( 1 ) ;
216
202
expect ( stderr . match ( / S t o r e d p a c k / g) ) . toHaveLength ( 1 ) ;
203
+ expect ( stderr ) . toBeTruthy ( ) ;
217
204
expect ( stdout ) . toBeTruthy ( ) ;
218
205
}
219
206
@@ -222,11 +209,10 @@ describe('cache', () => {
222
209
expect ( exitCode ) . toEqual ( 0 ) ;
223
210
224
211
if ( isWebpack5 ) {
225
- expect ( stderr ) . toContain ( "Compilation 'cache-test-autoloading' starting..." ) ;
226
- expect ( stderr ) . toContain ( "Compilation 'cache-test-autoloading' finished" ) ;
227
212
expect ( stderr . match ( / r e s t o r e c a c h e c o n t a i n e r : / g) ) . toHaveLength ( 1 ) ;
228
213
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t m e t a d a t a : / g) ) . toHaveLength ( 1 ) ;
229
214
expect ( stderr . match ( / r e s t o r e c a c h e c o n t e n t \d + \( .+ \) : / g) ) . toHaveLength ( 1 ) ;
215
+ expect ( stderr ) . toBeTruthy ( ) ;
230
216
expect ( stdout ) . toBeTruthy ( ) ;
231
217
}
232
218
} ) ;
0 commit comments