import { describe, expect, it } from "vitest"; import { app } from "../src/app"; describe("app", () => { it("reports health", async () => { const res = await app.request("/health"); expect(res.status).toBe(200); expect(await res.json()).toEqual({ status: "ok" }); }); it("returns JSON for unknown routes", async () => { const res = await app.request("/nope"); expect(res.status).toBe(404); expect(await res.json()).toEqual({ error: "Not found" }); }); it("sets security headers", async () => { const res = await app.request("/health"); expect(res.headers.get("x-content-type-options")).toBe("nosniff"); }); });