mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-14 18:13:54 +00:00
test: fix assertion for style snapshot
This commit is contained in:
parent
4a84ec89e6
commit
7f311e7730
@ -1834,7 +1834,13 @@ describe.skipIf(isDev() || isWebpack)('inlining component styles', () => {
|
||||
|
||||
it('does not load stylesheet for page styles', async () => {
|
||||
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 () => {
|
||||
|
Loading…
Reference in New Issue
Block a user