diff --git a/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js b/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js
index 070be9e4a7..1f349b9416 100644
--- a/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js
+++ b/packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js
@@ -30,16 +30,16 @@ 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 as=script>/)
- expect(index).toMatch(/]+js\/chunk-vendors[^>]+\.js rel=preload as=script>/)
+ 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 as=style>/)
+ expect(index).toMatch(/]+app[^>]+\.css" rel="preload" as="style">/)
// PWA specific directives
- expect(index).toMatch(``)
+ expect(index).toMatch(``)
// favicon is not minified because it's technically a comment
expect(index).toMatch(``)
- expect(index).toMatch(``)
+ expect(index).toMatch(``)
// should import service worker script
const main = await project.read('src/main.js')
diff --git a/packages/@vue/cli-service/__tests__/build.spec.js b/packages/@vue/cli-service/__tests__/build.spec.js
index 070d29a559..85948f1217 100644
--- a/packages/@vue/cli-service/__tests__/build.spec.js
+++ b/packages/@vue/cli-service/__tests__/build.spec.js
@@ -28,19 +28,19 @@ test('build', 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 as=script>/)
- expect(index).toMatch(/]+js\/chunk-vendors[^>]+\.js rel=preload as=script>/)
+ 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 as=style>/)
+ expect(index).toMatch(/]+app[^>]+\.css" rel="preload" as="style">/)
// should inject scripts
- expect(index).toMatch(/