all repos — website @ a25028aa30bf0f3b89a9a7c99192e1a14267fc97

My website

Initial commit

Alan Pearce
commit

a25028aa30bf0f3b89a9a7c99192e1a14267fc97

1 file changed, 21 insertions(+), 0 deletions(-)

changed files
A test/index.test.ts
@@ -0,0 +1,21 @@
+import { type Server } from "bun" +import { expect, test, beforeAll, afterAll } from "bun:test" + +import app from "../src/index" + +const port = 33000; +let server: Server + +beforeAll(async function () { + server = Bun.serve(Object.assign({}, app, { port })) +}) + +afterAll(function () { + server.stop() +}) + +test("/status returns 200 OK", async function () { + const res = await fetch(`http://localhost:${port}/status`) + expect(res.status).toBe(200) + expect(await res.text()).toBe("OK") +})