mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-05-06 11:59:17 -05:00
ci: fix pwa spec
This commit is contained in:
@@ -30,10 +30,10 @@ test('pwa', async () => {
|
||||
const index = await project.read('dist/index.html')
|
||||
|
||||
// should split and preload app.js & vendor.js
|
||||
expect(index).toMatch(/<link [^>]+js\/app[^>]+\.js rel=preload>/)
|
||||
expect(index).toMatch(/<link [^>]+js\/chunk-vendors[^>]+\.js rel=preload>/)
|
||||
expect(index).toMatch(/<link [^>]+js\/app[^>]+\.js rel=preload as=script>/)
|
||||
expect(index).toMatch(/<link [^>]+js\/chunk-vendors[^>]+\.js rel=preload as=script>/)
|
||||
// should preload css
|
||||
expect(index).toMatch(/<link [^>]+app[^>]+\.css rel=preload>/)
|
||||
expect(index).toMatch(/<link [^>]+app[^>]+\.css rel=preload as=style>/)
|
||||
|
||||
// PWA specific directives
|
||||
expect(index).toMatch(`<link rel=manifest href=/manifest.json>`)
|
||||
@@ -66,6 +66,10 @@ test('pwa', async () => {
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await browser.close()
|
||||
server.close()
|
||||
if (browser) {
|
||||
await browser.close()
|
||||
}
|
||||
if (server) {
|
||||
server.close()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user