mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-14 03:54:46 +00:00
Harden tests (...a bit)
This commit is contained in:
@@ -7,10 +7,9 @@ describe('with-sourcemaps', function() {
|
||||
this.timeout(10000);
|
||||
|
||||
// hooks
|
||||
before(async () => {
|
||||
await build({ cwd: __dirname });
|
||||
});
|
||||
before('build app', () => build({ cwd: __dirname }));
|
||||
|
||||
// tests
|
||||
it('does not put sourcemap files in service worker shell', async () => {
|
||||
const service_worker_source = fs.readFileSync(`${__dirname}/src/node_modules/@sapper/service-worker.js`, 'utf-8');
|
||||
const shell_source = /shell = (\[[\s\S]+?\])/.exec(service_worker_source)[1];
|
||||
@@ -23,4 +22,4 @@ describe('with-sourcemaps', function() {
|
||||
const sourcemapFiles = fs.readdirSync(clientShellDir).filter(_ => _.endsWith('.map'));
|
||||
assert.ok(sourcemapFiles.length > 0, 'sourcemap files exist');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user