Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('pwa', async () => {
// it's ok to mutate here since jest loads each test in a separate vm
defaultPreset.plugins['@vue/cli-plugin-pwa'] = {}
const project = await create('pwa-build', defaultPreset)
expect(project.has('src/registerServiceWorker.js')).toBe(true)
const { stdout } = await project.run('vue-cli-service build')
expect(stdout).toMatch('Build complete.')
expect(project.has('dist/index.html')).toBe(true)
expect(project.has('dist/favicon.ico')).toBe(true)
expect(project.has('dist/js')).toBe(true)
expect(project.has('dist/css')).toBe(true)
// PWA specific files
expect(project.has('dist/manifest.json')).toBe(true)
expect(project.has('dist/img/icons/android-chrome-512x512.png')).toBe(true)
// Make sure the base preload/prefetch are not affected