Skip to content

Commit 057dfc1

Browse files
committed
update snapshot
1 parent 90721c3 commit 057dfc1

File tree

1 file changed

+38
-33
lines changed

1 file changed

+38
-33
lines changed

test/integration/css/test/basic-global-support.test.js

+38-33
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,28 @@ module.exports = {
6262
if (process.env.TURBOPACK && useLightningcss) {
6363
expect(cssContent).toMatchInlineSnapshot(`
6464
[
65-
"/_next/static/chunks/test_integration_css-fixtures_single-global_styles_global_04ffe231.css:
65+
"/_next/static/chunks/HASH.css:
6666
.red-text{color:red}",
6767
]
6868
`)
6969
} else if (process.env.TURBOPACK && !useLightningcss) {
7070
expect(cssContent).toMatchInlineSnapshot(`
7171
[
72-
"/_next/static/chunks/test_integration_css-fixtures_single-global_styles_global_04ffe231.css:
72+
"/_next/static/chunks/HASH.css:
7373
.red-text{color:red}",
7474
]
7575
`)
7676
} else if (useLightningcss) {
7777
expect(cssContent).toMatchInlineSnapshot(`
7878
[
79-
"/_next/static/css/e6f86e82ed770205.css:
79+
"/_next/static/css/HASH.css:
8080
.red-text{color:red}",
8181
]
8282
`)
8383
} else {
8484
expect(cssContent).toMatchInlineSnapshot(`
8585
[
86-
"/_next/static/css/e6f86e82ed770205.css:
86+
"/_next/static/css/HASH.css:
8787
.red-text{color:red}",
8888
]
8989
`)
@@ -146,28 +146,28 @@ module.exports = {
146146
if (process.env.TURBOPACK && useLightningcss) {
147147
expect(cssContent).toMatchInlineSnapshot(`
148148
[
149-
"/_next/static/chunks/aa64a_css-fixtures_single-global-special-characters_a%2Bb_styles_global_238bffda.css:
149+
"/_next/static/chunks/HASH.css:
150150
.red-text{color:red}",
151151
]
152152
`)
153153
} else if (process.env.TURBOPACK && !useLightningcss) {
154154
expect(cssContent).toMatchInlineSnapshot(`
155155
[
156-
"/_next/static/chunks/aa64a_css-fixtures_single-global-special-characters_a%2Bb_styles_global_238bffda.css:
156+
"/_next/static/chunks/HASH.css:
157157
.red-text{color:red}",
158158
]
159159
`)
160160
} else if (useLightningcss) {
161161
expect(cssContent).toMatchInlineSnapshot(`
162162
[
163-
"/_next/static/css/e6f86e82ed770205.css:
163+
"/_next/static/css/HASH.css:
164164
.red-text{color:red}",
165165
]
166166
`)
167167
} else {
168168
expect(cssContent).toMatchInlineSnapshot(`
169169
[
170-
"/_next/static/css/e6f86e82ed770205.css:
170+
"/_next/static/css/HASH.css:
171171
.red-text{color:red}",
172172
]
173173
`)
@@ -225,28 +225,28 @@ module.exports = {
225225
if (process.env.TURBOPACK && useLightningcss) {
226226
expect(cssContent).toMatchInlineSnapshot(`
227227
[
228-
"/_next/static/chunks/test_integration_css-fixtures_single-global-src_styles_global_3de272ac.css:
228+
"/_next/static/chunks/HASH.css:
229229
.red-text{color:red}",
230230
]
231231
`)
232232
} else if (process.env.TURBOPACK && !useLightningcss) {
233233
expect(cssContent).toMatchInlineSnapshot(`
234234
[
235-
"/_next/static/chunks/test_integration_css-fixtures_single-global-src_styles_global_3de272ac.css:
235+
"/_next/static/chunks/HASH.css:
236236
.red-text{color:red}",
237237
]
238238
`)
239239
} else if (useLightningcss) {
240240
expect(cssContent).toMatchInlineSnapshot(`
241241
[
242-
"/_next/static/css/e6f86e82ed770205.css:
242+
"/_next/static/css/HASH.css:
243243
.red-text{color:red}",
244244
]
245245
`)
246246
} else {
247247
expect(cssContent).toMatchInlineSnapshot(`
248248
[
249-
"/_next/static/css/e6f86e82ed770205.css:
249+
"/_next/static/css/HASH.css:
250250
.red-text{color:red}",
251251
]
252252
`)
@@ -305,7 +305,7 @@ module.exports = {
305305
if (process.env.TURBOPACK && useLightningcss) {
306306
expect(cssContent).toMatchInlineSnapshot(`
307307
[
308-
"/_next/static/chunks/test_integration_css-fixtures_multi-global_styles_e0f6ec64._.css:
308+
"/_next/static/chunks/HASH.css:
309309
.red-text{color:red}
310310
311311
@@ -315,7 +315,7 @@ module.exports = {
315315
} else if (process.env.TURBOPACK && !useLightningcss) {
316316
expect(cssContent).toMatchInlineSnapshot(`
317317
[
318-
"/_next/static/chunks/test_integration_css-fixtures_multi-global_styles_e0f6ec64._.css:
318+
"/_next/static/chunks/HASH.css:
319319
.red-text{color:red}
320320
321321
@@ -325,14 +325,14 @@ module.exports = {
325325
} else if (useLightningcss) {
326326
expect(cssContent).toMatchInlineSnapshot(`
327327
[
328-
"/_next/static/css/5e3a80a101f2afdd.css:
328+
"/_next/static/css/HASH.css:
329329
.red-text{color:red}.blue-text{color:#00f}",
330330
]
331331
`)
332332
} else {
333333
expect(cssContent).toMatchInlineSnapshot(`
334334
[
335-
"/_next/static/css/52172921917299d1.css:
335+
"/_next/static/css/HASH.css:
336336
.red-text{color:red}.blue-text{color:blue}",
337337
]
338338
`)
@@ -391,7 +391,7 @@ module.exports = {
391391
if (process.env.TURBOPACK && useLightningcss) {
392392
expect(cssContent).toMatchInlineSnapshot(`
393393
[
394-
"/_next/static/chunks/test_integration_css-fixtures_nested-global_styles_613f73a3._.css:
394+
"/_next/static/chunks/HASH.css:
395395
.red-text{color:purple;font-weight:bolder}
396396
397397
@@ -407,7 +407,7 @@ module.exports = {
407407
} else if (process.env.TURBOPACK && !useLightningcss) {
408408
expect(cssContent).toMatchInlineSnapshot(`
409409
[
410-
"/_next/static/chunks/test_integration_css-fixtures_nested-global_styles_613f73a3._.css:
410+
"/_next/static/chunks/HASH.css:
411411
.red-text{color:purple;font-weight:bolder}
412412
413413
@@ -423,14 +423,14 @@ module.exports = {
423423
} else if (useLightningcss) {
424424
expect(cssContent).toMatchInlineSnapshot(`
425425
[
426-
"/_next/static/css/197173a06644483f.css:
426+
"/_next/static/css/HASH.css:
427427
.red-text{color:purple;font-weight:bolder;color:red}.blue-text{color:orange;font-weight:bolder;color:#00f}",
428428
]
429429
`)
430430
} else {
431431
expect(cssContent).toMatchInlineSnapshot(`
432432
[
433-
"/_next/static/css/5fd4808215677a0f.css:
433+
"/_next/static/css/HASH.css:
434434
.red-text{color:purple;font-weight:bolder;color:red}.blue-text{color:orange;font-weight:bolder;color:blue}",
435435
]
436436
`)
@@ -490,7 +490,7 @@ module.exports = {
490490
if (process.env.TURBOPACK && useLightningcss) {
491491
expect(cssContent).toMatchInlineSnapshot(`
492492
[
493-
"/_next/static/chunks/test_integration_css-fixtures_multi-global-reversed_styles_9924990c._.css:
493+
"/_next/static/chunks/HASH.css:
494494
.blue-text{color:#00f}
495495
496496
@@ -500,7 +500,7 @@ module.exports = {
500500
} else if (process.env.TURBOPACK && !useLightningcss) {
501501
expect(cssContent).toMatchInlineSnapshot(`
502502
[
503-
"/_next/static/chunks/test_integration_css-fixtures_multi-global-reversed_styles_9924990c._.css:
503+
"/_next/static/chunks/HASH.css:
504504
.blue-text{color:#00f}
505505
506506
@@ -510,14 +510,14 @@ module.exports = {
510510
} else if (useLightningcss) {
511511
expect(cssContent).toMatchInlineSnapshot(`
512512
[
513-
"/_next/static/css/67c5003fc41fdadb.css:
513+
"/_next/static/css/HASH.css:
514514
.blue-text{color:#00f}.red-text{color:red}",
515515
]
516516
`)
517517
} else {
518518
expect(cssContent).toMatchInlineSnapshot(`
519519
[
520-
"/_next/static/css/f06b052da7bb0328.css:
520+
"/_next/static/css/HASH.css:
521521
.blue-text{color:blue}.red-text{color:red}",
522522
]
523523
`)
@@ -576,7 +576,7 @@ module.exports = {
576576
if (process.env.TURBOPACK && useLightningcss) {
577577
expect(cssContent).toMatchInlineSnapshot(`
578578
[
579-
"/_next/static/chunks/test_integration_css-fixtures_url-global_styles_46281715._.css:
579+
"/_next/static/chunks/HASH.css:
580580
.red-text{color:red;background-image:url(../media/dark.993bedd3.svg),url(../media/dark2.993bedd3.svg)}
581581
582582
@@ -589,7 +589,7 @@ module.exports = {
589589
} else if (process.env.TURBOPACK && !useLightningcss) {
590590
expect(cssContent).toMatchInlineSnapshot(`
591591
[
592-
"/_next/static/chunks/test_integration_css-fixtures_url-global_styles_46281715._.css:
592+
"/_next/static/chunks/HASH.css:
593593
.red-text{color:red;background-image:url(../media/dark.993bedd3.svg),url(../media/dark2.993bedd3.svg)}
594594
595595
@@ -602,14 +602,14 @@ module.exports = {
602602
} else if (useLightningcss) {
603603
expect(cssContent).toMatchInlineSnapshot(`
604604
[
605-
"/_next/static/css/02830b0dd136adeb.css:
605+
"/_next/static/css/HASH.css:
606606
.red-text{color:red;background-image:url(/_next/static/media/dark.6b01655b.svg),url(/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;background-image:url(/_next/static/media/light.2da1d3d6.svg);font-weight:bolder;color:#00f}",
607607
]
608608
`)
609609
} else {
610610
expect(cssContent).toMatchInlineSnapshot(`
611611
[
612-
"/_next/static/css/bf86b6e30872ca37.css:
612+
"/_next/static/css/HASH.css:
613613
.red-text{color:red;background-image:url(/_next/static/media/dark.6b01655b.svg),url(/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;font-weight:bolder;background-image:url(/_next/static/media/light.2da1d3d6.svg);color:blue}",
614614
]
615615
`)
@@ -653,7 +653,7 @@ describe('CSS URL via `file-loader` and asset prefix (1)', () => {
653653
if (process.env.TURBOPACK) {
654654
expect(cssContent).toMatchInlineSnapshot(`
655655
[
656-
"/_next/static/chunks/test_integration_css-fixtures_url-global-asset-prefix-1_styles_e99cb7f8._.css:
656+
"/_next/static/chunks/HASH.css:
657657
.red-text{color:red;background-image:url(../media/dark.993bedd3.svg) url(../media/dark2.993bedd3.svg)}
658658
659659
@@ -666,7 +666,7 @@ describe('CSS URL via `file-loader` and asset prefix (1)', () => {
666666
} else {
667667
expect(cssContent).toMatchInlineSnapshot(`
668668
[
669-
"/_next/static/css/18198e5ba4d54f6f.css:
669+
"/_next/static/css/HASH.css:
670670
.red-text{color:red;background-image:url(/foo/_next/static/media/dark.6b01655b.svg) url(/foo/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;font-weight:bolder;background-image:url(/foo/_next/static/media/light.2da1d3d6.svg);color:blue}",
671671
]
672672
`)
@@ -709,7 +709,7 @@ describe('CSS URL via `file-loader` and asset prefix (2)', () => {
709709
if (process.env.TURBOPACK) {
710710
expect(cssContent).toMatchInlineSnapshot(`
711711
[
712-
"/_next/static/chunks/test_integration_css-fixtures_url-global-asset-prefix-2_styles_7b29c72b._.css:
712+
"/_next/static/chunks/HASH.css:
713713
.red-text{color:red;background-image:url(../media/dark.993bedd3.svg) url(../media/dark2.993bedd3.svg)}
714714
715715
@@ -722,7 +722,7 @@ describe('CSS URL via `file-loader` and asset prefix (2)', () => {
722722
} else {
723723
expect(cssContent).toMatchInlineSnapshot(`
724724
[
725-
"/_next/static/css/18198e5ba4d54f6f.css:
725+
"/_next/static/css/HASH.css:
726726
.red-text{color:red;background-image:url(/foo/_next/static/media/dark.6b01655b.svg) url(/foo/_next/static/media/dark2.6b01655b.svg)}.blue-text{color:orange;font-weight:bolder;background-image:url(/foo/_next/static/media/light.2da1d3d6.svg);color:blue}",
727727
]
728728
`)
@@ -741,7 +741,12 @@ async function getStylesheetContents($, appPort, items) {
741741
if (res.status !== 200)
742742
throw new Error(`Failed to load stylesheet: ${href}`)
743743
const text = await res.text()
744-
results.push(`${href}:\n${text.replace(/\/\*.*?\*\//g, '').trim()}`)
744+
results.push(
745+
`${href.replace(
746+
/[0-9a-f]{8,}/g,
747+
'HASH'
748+
)}:\n${text.replace(/\/\*.*?\*\//g, '').trim()}`
749+
)
745750
}
746751
return results
747752
}

0 commit comments

Comments
 (0)