Skip to content

Commit 18f65e5

Browse files
committed
chore: broken tests unhead v2
1 parent dbad4c1 commit 18f65e5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

test/fixtures/basic/__runtime__/warmup.nuxt.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ describe('script warmup', () => {
1212
head,
1313
})
1414
const ssr = await renderSSRHead(head)
15-
expect(ssr.headTags.split(' ').sort()).toMatchInlineSnapshot(`
15+
expect(ssr.headTags.replace('>', '').split(' ').sort()).toMatchInlineSnapshot(`
1616
[
1717
"<link",
1818
"as="script"",
1919
"fetchpriority="low"",
2020
"href="/preload.js"",
21-
"rel="preload">",
21+
"rel="preload"",
2222
]
2323
`)
2424
script.remove()
@@ -33,13 +33,13 @@ describe('script warmup', () => {
3333
head,
3434
})
3535
const ssr = await renderSSRHead(head)
36-
expect(ssr.headTags.split(' ').sort()).toMatchInlineSnapshot(`
36+
expect(ssr.headTags.replace('>', '').split(' ').sort()).toMatchInlineSnapshot(`
3737
[
3838
"<link",
3939
"as="script"",
4040
"fetchpriority="low"",
4141
"href="/preload.js"",
42-
"rel="preload">",
42+
"rel="preload"",
4343
]
4444
`)
4545
script.remove()
@@ -67,14 +67,14 @@ describe('script warmup', () => {
6767
head,
6868
})
6969
const ssr = await renderSSRHead(head)
70-
expect(ssr.headTags.split(' ').sort()).toMatchInlineSnapshot(`
70+
expect(ssr.headTags.replace('>', '').split(' ').sort()).toMatchInlineSnapshot(`
7171
[
7272
"<link",
7373
"crossorigin="anonymous"",
7474
"fetchpriority="low"",
7575
"href="https:example.com"",
7676
"referrerpolicy="no-referrer"",
77-
"rel="preconnect">",
77+
"rel="preconnect"",
7878
]
7979
`)
8080
script.remove()
@@ -89,15 +89,15 @@ describe('script warmup', () => {
8989
head,
9090
})
9191
const ssr = await renderSSRHead(head)
92-
expect(ssr.headTags.split(' ').sort()).toMatchInlineSnapshot(`
92+
expect(ssr.headTags.replace('>', '').split(' ').sort()).toMatchInlineSnapshot(`
9393
[
9494
"<link",
9595
"as="script"",
9696
"crossorigin="anonymous"",
9797
"fetchpriority="low"",
9898
"href="https://example.com/preload.js"",
9999
"referrerpolicy="no-referrer"",
100-
"rel="preload">",
100+
"rel="preload"",
101101
]
102102
`)
103103
script.remove()
@@ -112,15 +112,15 @@ describe('script warmup', () => {
112112
head,
113113
})
114114
const ssr = await renderSSRHead(head)
115-
expect(ssr.headTags.split(' ').sort()).toMatchInlineSnapshot(`
115+
expect(ssr.headTags.replace('>', '').split(' ').sort()).toMatchInlineSnapshot(`
116116
[
117117
"<link",
118118
"as="script"",
119119
"crossorigin="use-credentials"",
120120
"fetchpriority="low"",
121121
"href="https://s.kk-resources.com/leadtag.js"",
122122
"referrerpolicy="no-referrer-when-downgrade"",
123-
"rel="preload">",
123+
"rel="preload"",
124124
]
125125
`)
126126
script.remove()
@@ -135,14 +135,14 @@ describe('script warmup', () => {
135135
head,
136136
})
137137
const ssr = await renderSSRHead(head)
138-
expect(ssr.headTags.split(' ').sort()).toMatchInlineSnapshot(`
138+
expect(ssr.headTags.replace('>', '').split(' ').sort()).toMatchInlineSnapshot(`
139139
[
140140
"<link",
141141
"as="script"",
142142
"fetchpriority="low"",
143143
"href="https://s.kk-resources.com/leadtag.js"",
144144
"referrerpolicy="no-referrer"",
145-
"rel="preload">",
145+
"rel="preload"",
146146
]
147147
`)
148148
script.remove()

0 commit comments

Comments
 (0)