add default route for tests

This commit is contained in:
silverwind 2020-07-21 20:38:38 +02:00
parent 391e5b1242
commit 5fe99980d8
Signed by: silverwind
GPG Key ID: 2E62B41C93869443

@ -35,13 +35,18 @@ function makeUrl(server) {
return Object.assign(new URL("http://x"), {hostname, port}).toString();
}
function defaultRoute(req, res) {
console.error(`default handler hit for ${req.url}`);
res.send(404);
}
let npmServer, githubServer, githubUrl, npmUrl;
beforeAll(async () => {
let commits, tags;
[npmServer, githubServer, commits, tags] = await Promise.all([
restana(),
restana(),
restana({defaultRoute}),
restana({defaultRoute}),
readFile(join(__dirname, "fixtures/github/updates-commits.json")),
readFile(join(__dirname, "fixtures/github/updates-tags.json"))
]);