fix: resolve type errors across test suite

This commit is contained in:
2026-02-26 12:49:04 -06:00
parent 827b018f25
commit 51eb36f4a6
26 changed files with 2847 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import { describe, test, expect } from "bun:test";
import teapot from "../../src/api/teapot";
describe("Teapot route handler", () => {
test("GET / returns 418 status", async () => {
const res = await teapot.request("/");
expect(res.status).toBe(418);
});
test("response body has correct shape", async () => {
const res = await teapot.request("/");
const body = await res.json();
expect(body).toEqual({
status: 418,
message: "I'm not a teapot",
successful: true,
});
});
test("returns JSON content type", async () => {
const res = await teapot.request("/");
const ct = res.headers.get("content-type");
expect(ct).toContain("application/json");
});
});