mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 02:14:44 +00:00
test: fix assertion for style snapshot
This commit is contained in:
parent
2c843ce156
commit
ed0038200c
@ -1831,7 +1831,13 @@ describe.skipIf(isDev() || isWebpack)('inlining component styles', () => {
|
|||||||
|
|
||||||
it('does not load stylesheet for page styles', async () => {
|
it('does not load stylesheet for page styles', async () => {
|
||||||
const html: string = await $fetch<string>('/styles')
|
const html: string = await $fetch<string>('/styles')
|
||||||
expect(html.match(/<link [^>]*href="[^"]*\.css">(?: crossorigin)?/g)?.filter(m => m.includes('entry'))?.map(m => m.replace(/\.[^.]*\.css/, '.css'))).toMatchInlineSnapshot(`undefined`)
|
const cssFiles = html.match(/<link [^>]*href="[^"]*\.css"/g)
|
||||||
|
expect(cssFiles?.length).toBeGreaterThan(0)
|
||||||
|
expect(cssFiles?.filter(m => m.includes('entry'))?.map(m => m.replace(/\.[^.]*\.css/, '.css'))).toMatchInlineSnapshot(`
|
||||||
|
[
|
||||||
|
"<link rel="stylesheet" href="/_nuxt/entry.css"",
|
||||||
|
]
|
||||||
|
`)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('still downloads client-only styles', async () => {
|
it('still downloads client-only styles', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user