From 414ac5f9f20c3d46b13a7aa7085ca00e1791e608 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 9 Aug 2018 01:40:24 -0400 Subject: [PATCH] ci: fix pwa spec --- .../cli-plugin-pwa/__tests__/pwaPlugin.spec.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js b/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js index a5f77e3de..0f866e8c8 100644 --- a/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js +++ b/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js @@ -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(/]+js\/app[^>]+\.js rel=preload>/) - expect(index).toMatch(/]+js\/chunk-vendors[^>]+\.js rel=preload>/) + expect(index).toMatch(/]+js\/app[^>]+\.js rel=preload as=script>/) + expect(index).toMatch(/]+js\/chunk-vendors[^>]+\.js rel=preload as=script>/) // should preload css - expect(index).toMatch(/]+app[^>]+\.css rel=preload>/) + expect(index).toMatch(/]+app[^>]+\.css rel=preload as=style>/) // PWA specific directives expect(index).toMatch(``) @@ -66,6 +66,10 @@ test('pwa', async () => { }) afterAll(async () => { - await browser.close() - server.close() + if (browser) { + await browser.close() + } + if (server) { + server.close() + } })