overhaul tests

This commit is contained in:
Rich Harris
2018-10-07 18:23:43 -04:00
committed by GitHub
parent 18acef3190
commit 5e59855a15
183 changed files with 4145 additions and 3126 deletions

View File

@@ -0,0 +1,22 @@
import polka from 'polka';
import { Store } from 'svelte/store.js';
import * as sapper from '../__sapper__/server.js';
const { PORT } = process.env;
polka()
.use((req, res, next) => {
req.hello = 'hello';
res.locals = { name: 'world' };
next();
})
.use(
sapper.middleware({
store: (req, res) => {
return new Store({
title: `${req.hello} ${res.locals.name}`
});
}
})
)
.listen(PORT);