Skip to content

Commit bf7e7f4

Browse files
test: fix
1 parent 3e252e7 commit bf7e7f4

File tree

2 files changed

+146
-160
lines changed

2 files changed

+146
-160
lines changed

test/TestCache.test.js

+146-32
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,28 @@ describe('TestCache', () => {
5858
return;
5959
}
6060

61-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
62-
'first'
61+
expect(
62+
Object.keys(stats.compilation.assets).sort()
63+
).toMatchInlineSnapshot(
64+
`
65+
Array [
66+
"main.css",
67+
"main.js",
68+
"static/react.svg",
69+
]
70+
`
6371
);
6472
expect(
6573
Array.from(stats.compilation.emittedAssets).sort()
66-
).toMatchSnapshot('first emitted');
74+
).toMatchInlineSnapshot(
75+
`
76+
Array [
77+
"main.css",
78+
"main.js",
79+
"static/react.svg",
80+
]
81+
`
82+
);
6783
expect(stats.compilation.warnings).toHaveLength(0);
6884
expect(stats.compilation.errors).toHaveLength(0);
6985

@@ -91,12 +107,20 @@ describe('TestCache', () => {
91107
return;
92108
}
93109

94-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
95-
'second'
110+
expect(
111+
Object.keys(stats.compilation.assets).sort()
112+
).toMatchInlineSnapshot(
113+
`
114+
Array [
115+
"main.css",
116+
"main.js",
117+
"static/react.svg",
118+
]
119+
`
96120
);
97121
expect(
98122
Array.from(stats.compilation.emittedAssets).sort()
99-
).toMatchSnapshot('second emitted');
123+
).toMatchInlineSnapshot(`Array []`);
100124
expect(stats.compilation.warnings).toHaveLength(0);
101125
expect(stats.compilation.errors).toHaveLength(0);
102126

@@ -158,12 +182,28 @@ describe('TestCache', () => {
158182
return;
159183
}
160184

161-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
162-
'first'
185+
expect(
186+
Object.keys(stats.compilation.assets).sort()
187+
).toMatchInlineSnapshot(
188+
`
189+
Array [
190+
"main.css",
191+
"main.js",
192+
"static/react.svg",
193+
]
194+
`
163195
);
164196
expect(
165197
Array.from(stats.compilation.emittedAssets).sort()
166-
).toMatchSnapshot('first emitted');
198+
).toMatchInlineSnapshot(
199+
`
200+
Array [
201+
"main.css",
202+
"main.js",
203+
"static/react.svg",
204+
]
205+
`
206+
);
167207
expect(stats.compilation.warnings).toHaveLength(0);
168208
expect(stats.compilation.errors).toHaveLength(0);
169209

@@ -193,12 +233,20 @@ describe('TestCache', () => {
193233
return;
194234
}
195235

196-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
197-
'second'
236+
expect(
237+
Object.keys(stats.compilation.assets).sort()
238+
).toMatchInlineSnapshot(
239+
`
240+
Array [
241+
"main.css",
242+
"main.js",
243+
"static/react.svg",
244+
]
245+
`
198246
);
199247
expect(
200248
Array.from(stats.compilation.emittedAssets).sort()
201-
).toMatchSnapshot('second emitted');
249+
).toMatchInlineSnapshot(`Array []`);
202250
expect(stats.compilation.warnings).toHaveLength(0);
203251
expect(stats.compilation.errors).toHaveLength(0);
204252

@@ -267,12 +315,23 @@ describe('TestCache', () => {
267315
return;
268316
}
269317

270-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
271-
'first'
272-
);
273318
expect(
274-
Array.from(stats.compilation.emittedAssets).sort()
275-
).toMatchSnapshot('first emitted');
319+
Object.keys(stats.compilation.assets).sort()
320+
).toMatchInlineSnapshot(
321+
`
322+
Array [
323+
"main.css",
324+
"main.js",
325+
]
326+
`
327+
);
328+
expect(Array.from(stats.compilation.emittedAssets).sort())
329+
.toMatchInlineSnapshot(`
330+
Array [
331+
"main.css",
332+
"main.js",
333+
]
334+
`);
276335
expect(stats.compilation.warnings).toHaveLength(0);
277336
expect(stats.compilation.errors).toHaveLength(0);
278337

@@ -305,12 +364,19 @@ describe('TestCache', () => {
305364
return;
306365
}
307366

308-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
309-
'second'
367+
expect(
368+
Object.keys(stats.compilation.assets).sort()
369+
).toMatchInlineSnapshot(
370+
`
371+
Array [
372+
"main.css",
373+
"main.js",
374+
]
375+
`
310376
);
311377
expect(
312378
Array.from(stats.compilation.emittedAssets).sort()
313-
).toMatchSnapshot('second emitted');
379+
).toMatchInlineSnapshot(`Array []`);
314380
expect(stats.compilation.warnings).toHaveLength(0);
315381
expect(stats.compilation.errors).toHaveLength(0);
316382

@@ -379,12 +445,28 @@ describe('TestCache', () => {
379445
return;
380446
}
381447

382-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
383-
'first'
448+
expect(
449+
Object.keys(stats.compilation.assets).sort()
450+
).toMatchInlineSnapshot(
451+
`
452+
Array [
453+
"main.css",
454+
"main.js",
455+
"static/react.svg",
456+
]
457+
`
384458
);
385459
expect(
386460
Array.from(stats.compilation.emittedAssets).sort()
387-
).toMatchSnapshot('first emitted');
461+
).toMatchInlineSnapshot(
462+
`
463+
Array [
464+
"main.css",
465+
"main.js",
466+
"static/react.svg",
467+
]
468+
`
469+
);
388470
expect(stats.compilation.warnings).toHaveLength(0);
389471
expect(stats.compilation.errors).toHaveLength(0);
390472

@@ -417,12 +499,20 @@ describe('TestCache', () => {
417499
return;
418500
}
419501

420-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
421-
'second'
502+
expect(
503+
Object.keys(stats.compilation.assets).sort()
504+
).toMatchInlineSnapshot(
505+
`
506+
Array [
507+
"main.css",
508+
"main.js",
509+
"static/react.svg",
510+
]
511+
`
422512
);
423513
expect(
424514
Array.from(stats.compilation.emittedAssets).sort()
425-
).toMatchSnapshot('second emitted');
515+
).toMatchInlineSnapshot(`Array []`);
426516
expect(stats.compilation.warnings).toHaveLength(0);
427517
expect(stats.compilation.errors).toHaveLength(0);
428518

@@ -491,12 +581,28 @@ describe('TestCache', () => {
491581
return;
492582
}
493583

494-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
495-
'first'
584+
expect(
585+
Object.keys(stats.compilation.assets).sort()
586+
).toMatchInlineSnapshot(
587+
`
588+
Array [
589+
"main.css",
590+
"main.js",
591+
"static/react.svg",
592+
]
593+
`
496594
);
497595
expect(
498596
Array.from(stats.compilation.emittedAssets).sort()
499-
).toMatchSnapshot('first emitted');
597+
).toMatchInlineSnapshot(
598+
`
599+
Array [
600+
"main.css",
601+
"main.js",
602+
"static/react.svg",
603+
]
604+
`
605+
);
500606
expect(stats.compilation.warnings).toHaveLength(0);
501607
expect(stats.compilation.errors).toHaveLength(0);
502608

@@ -529,12 +635,20 @@ describe('TestCache', () => {
529635
return;
530636
}
531637

532-
expect(Object.keys(stats.compilation.assets).sort()).toMatchSnapshot(
533-
'second'
638+
expect(
639+
Object.keys(stats.compilation.assets).sort()
640+
).toMatchInlineSnapshot(
641+
`
642+
Array [
643+
"main.css",
644+
"main.js",
645+
"static/react.svg",
646+
]
647+
`
534648
);
535649
expect(
536650
Array.from(stats.compilation.emittedAssets).sort()
537-
).toMatchSnapshot('second emitted');
651+
).toMatchInlineSnapshot(`Array []`);
538652
expect(stats.compilation.warnings).toHaveLength(0);
539653
expect(stats.compilation.errors).toHaveLength(0);
540654

0 commit comments

Comments
 (0)