Skip to content

Commit 414ac5f

Browse files
committed
ci: fix pwa spec
1 parent 55043d3 commit 414ac5f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ test('pwa', async () => {
3030
const index = await project.read('dist/index.html')
3131

3232
// should split and preload app.js & vendor.js
33-
expect(index).toMatch(/<link [^>]+js\/app[^>]+\.js rel=preload>/)
34-
expect(index).toMatch(/<link [^>]+js\/chunk-vendors[^>]+\.js rel=preload>/)
33+
expect(index).toMatch(/<link [^>]+js\/app[^>]+\.js rel=preload as=script>/)
34+
expect(index).toMatch(/<link [^>]+js\/chunk-vendors[^>]+\.js rel=preload as=script>/)
3535
// should preload css
36-
expect(index).toMatch(/<link [^>]+app[^>]+\.css rel=preload>/)
36+
expect(index).toMatch(/<link [^>]+app[^>]+\.css rel=preload as=style>/)
3737

3838
// PWA specific directives
3939
expect(index).toMatch(`<link rel=manifest href=/manifest.json>`)
@@ -66,6 +66,10 @@ test('pwa', async () => {
6666
})
6767

6868
afterAll(async () => {
69-
await browser.close()
70-
server.close()
69+
if (browser) {
70+
await browser.close()
71+
}
72+
if (server) {
73+
server.close()
74+
}
7175
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy