From 429f44e3a6d38692230dcc09bb95be89b02cad7c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 10 May 2019 08:00:21 -0400 Subject: [PATCH] get tests passing --- runtime/src/server/index.ts | 2 +- test/apps/basics/test.ts | 2 +- test/apps/export/test.ts | 4 ++-- test/apps/with-basepath/test.ts | 4 ++-- test/apps/with-sourcemaps-webpack/test.ts | 6 +++--- test/apps/with-sourcemaps/test.ts | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/runtime/src/server/index.ts b/runtime/src/server/index.ts index 46091c1..de9c2b9 100644 --- a/runtime/src/server/index.ts +++ b/runtime/src/server/index.ts @@ -1,4 +1,4 @@ -import * as http from 'http'; +import http from 'http'; import middleware from './middleware/index'; import { StartOptions, MiddlewareOptions, Handler } from './types'; diff --git a/test/apps/basics/test.ts b/test/apps/basics/test.ts index 9f24a8c..15864cc 100644 --- a/test/apps/basics/test.ts +++ b/test/apps/basics/test.ts @@ -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 = headers['link']; assert.ok(regex.test(link), link); diff --git a/test/apps/export/test.ts b/test/apps/export/test.ts index 181096c..1b33b27 100644 --- a/test/apps/export/test.ts +++ b/test/apps/export/test.ts @@ -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); diff --git a/test/apps/with-basepath/test.ts b/test/apps/with-basepath/test.ts index 0aae2fe..352b5d2 100644 --- a/test/apps/with-basepath/test.ts +++ b/test/apps/with-basepath/test.ts @@ -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); diff --git a/test/apps/with-sourcemaps-webpack/test.ts b/test/apps/with-sourcemaps-webpack/test.ts index 15b4fd1..ce2ba0a 100644 --- a/test/apps/with-sourcemaps-webpack/test.ts +++ b/test/apps/with-sourcemaps-webpack/test.ts @@ -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'); }); }); diff --git a/test/apps/with-sourcemaps/test.ts b/test/apps/with-sourcemaps/test.ts index 969bf9e..2e7c301 100644 --- a/test/apps/with-sourcemaps/test.ts +++ b/test/apps/with-sourcemaps/test.ts @@ -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'); }); });