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)