Skip to content

Commit e44b94a

Browse files
alexandre-mrtclaude
andcommitted
test: add HTTP response code tests (139)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 73e3cb1 commit e44b94a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/response-code.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { describe, expect, test } from "bun:test";
2+
import { Hono } from "hono";
3+
4+
process.env.DATABASE_URL = ":memory:";
5+
const { dropRouter } = await import("../src/routes/drop");
6+
const app = new Hono();
7+
app.route("/api", dropRouter);
8+
9+
describe("HTTP response codes", () => {
10+
test("stats returns 200", async () => {
11+
expect((await app.request("/api/stats")).status).toBe(200);
12+
});
13+
14+
test("missing drop returns 404", async () => {
15+
expect((await app.request("/api/missing/info")).status).toBe(404);
16+
});
17+
18+
test("no file upload returns 400", async () => {
19+
expect((await app.request("/api/upload", { method: "POST" })).status).toBe(400);
20+
});
21+
});

0 commit comments

Comments
 (0)