all repos — website @ 2f6152539c540697290ec73a7c1b50b9f2db88c6

My website

Use own logic for static file serving

Alan Pearce
commit

2f6152539c540697290ec73a7c1b50b9f2db88c6

parent

78439b16cc66532225e75c9aa40cf7c49cddc22d

1 file changed, 5 insertions(+), 7 deletions(-)

changed files
M test/index.test.tstest/index.test.ts
@@ -15,14 +15,12 @@ afterAll(function () {
server.stop(); }); -test("/status returns 200 OK", async function () { - const res = await fetch(new URL("/status", base)); +test("/ returns 200", async function () { + const res = await fetch(base); expect(res.status).toBe(200); - expect(await res.text()).toBe("OK"); }); -test("/ returns 200 and says Hello world", async function () { - const res = await fetch(base); - expect(res.status).toBe(200); - expect(await res.text()).toBe("Hello world"); +test("/asdf returns 404", async function () { + const res = await fetch(`${base}asdf`); + expect(res.status).toBe(404); });