all repos — website @ 51cc4389f6dc7947ee34d1b3367876941e8a8fbc

My website

Serve static files

Alan Pearce
commit

51cc4389f6dc7947ee34d1b3367876941e8a8fbc

parent

a25028aa30bf0f3b89a9a7c99192e1a14267fc97

1 file changed, 8 insertions(+), 1 deletion(-)

changed files
M test/index.test.tstest/index.test.ts
@@ -4,6 +4,7 @@
import app from "../src/index" const port = 33000; +const base = `http://localhost:${port}/`; let server: Server beforeAll(async function () {
@@ -15,7 +16,13 @@ server.stop()
}) test("/status returns 200 OK", async function () { - const res = await fetch(`http://localhost:${port}/status`) + const res = await fetch(new URL("/status", 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") +})