mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 04:14:46 +00:00
get tests passing
This commit is contained in:
@@ -140,7 +140,7 @@ describe('basics', function() {
|
||||
);
|
||||
|
||||
// TODO preload more than just the entry point
|
||||
const regex = /<\/client\/client\.\w+\.js>;rel="modulepreload"/;
|
||||
const regex = /<\/sapper\/client\.\w+\.js>;rel="modulepreload"/;
|
||||
const link = <string>headers['link'];
|
||||
|
||||
assert.ok(regex.test(link), link);
|
||||
|
||||
@@ -13,8 +13,8 @@ describe('export', function() {
|
||||
it('crawls a site', () => {
|
||||
const files = walk(`${__dirname}/__sapper__/export`);
|
||||
|
||||
const client_assets = files.filter(file => file.startsWith('client/'));
|
||||
const non_client_assets = files.filter(file => !file.startsWith('client/')).sort();
|
||||
const client_assets = files.filter(file => file.startsWith('sapper/'));
|
||||
const non_client_assets = files.filter(file => !file.startsWith('sapper/')).sort();
|
||||
|
||||
assert.ok(client_assets.length > 0);
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ describe('with-basepath', function() {
|
||||
it('crawls an exported site with basepath', () => {
|
||||
const files = walk(`${__dirname}/__sapper__/export`);
|
||||
|
||||
const client_assets = files.filter(file => file.startsWith('custom-basepath/client/'));
|
||||
const non_client_assets = files.filter(file => !file.startsWith('custom-basepath/client/')).sort();
|
||||
const client_assets = files.filter(file => file.startsWith('custom-basepath/sapper/'));
|
||||
const non_client_assets = files.filter(file => !file.startsWith('custom-basepath/sapper/')).sort();
|
||||
|
||||
assert.ok(client_assets.length > 0);
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ describe('with-sourcemaps-webpack', function() {
|
||||
assert.equal(shell.filter(_ => _.endsWith('.map')).length, 0,
|
||||
'sourcemap files are not cached in SW');
|
||||
|
||||
const clientShellDir = path.resolve(`${__dirname}/__sapper__/build`, path.dirname(shell[0]));
|
||||
const sourcemapFiles = fs.readdirSync(clientShellDir).filter(_ => _.endsWith('.map'));
|
||||
assert.ok(sourcemapFiles.length > 0, 'sourcemap files exist');
|
||||
const client_shell_dir = path.resolve(`${__dirname}/__sapper__/build/client`, path.dirname(shell[0]));
|
||||
const sourcemap_files = fs.readdirSync(client_shell_dir).filter(_ => _.endsWith('.map'));
|
||||
assert.ok(sourcemap_files.length > 0, 'sourcemap files exist');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -18,8 +18,8 @@ describe('with-sourcemaps', function() {
|
||||
assert.equal(shell.filter(_ => _.endsWith('.map')).length, 0,
|
||||
'sourcemap files are not cached in SW');
|
||||
|
||||
const clientShellDir = path.resolve(`${__dirname}/__sapper__/build`, path.dirname(shell[0]));
|
||||
const sourcemapFiles = fs.readdirSync(clientShellDir).filter(_ => _.endsWith('.map'));
|
||||
assert.ok(sourcemapFiles.length > 0, 'sourcemap files exist');
|
||||
const client_shell_dir = path.resolve(`${__dirname}/__sapper__/build/client`, path.dirname(shell[0]));
|
||||
const sourcemap_files = fs.readdirSync(client_shell_dir).filter(_ => _.endsWith('.map'));
|
||||
assert.ok(sourcemap_files.length > 0, 'sourcemap files exist');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user