Skip to content

Commit

Permalink
删除一个过时的测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
easonyq committed Apr 10, 2018
1 parent baad2f8 commit 4faef1b
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions packages/lavas-core-vue/test/unit/utils/workbox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,3 @@ test('it should generate service-worker.js in SPA mode with baseUrl', async t =>

t.true(swContent.indexOf('workboxSW.router.registerNavigationRoute(\'//static.somecdn.com/index.html\');') !== -1);
});

test('it should generate service-worker.js in SPA mode with invalid config', async t => {
let {core, tempDir} = t.context;
let config = merge(core.config, {
build: {
ssr: false
},
router: {
base: '/base-without-slash'
}
});
syncConfig(core, config);

let swTemplatePath = join(tempDir, 'core/service-worker.js');
let swTemplateContent = await readFile(swTemplatePath, 'utf8');
let swTemplateChangedContent = swTemplateContent.replace(
/workboxSW\.precache\(\[\]\);/,
'workboxSW.precache([ ]);'
);

await writeFile(swTemplatePath, swTemplateChangedContent, 'utf8');
await core.build();

let swContent = await readFile(join(tempDir, 'dist/service-worker.js'), 'utf8');

t.true(swContent.indexOf('workboxSW.router.registerNavigationRoute(\'/base-without-slash/index.html\');') !== -1);
});

0 comments on commit 4faef1b

Please sign in to comment.