We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 73e3cb1 commit e44b94aCopy full SHA for e44b94a
tests/response-code.test.ts
@@ -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