get tests passing

This commit is contained in:
Rich Harris
2019-05-10 08:00:21 -04:00
parent f8e853c02b
commit 429f44e3a6
6 changed files with 12 additions and 12 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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');
});
});

View File

@@ -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');
});
});