Skip to content

Commit b0a9f45

Browse files
alexandre-mrtclaude
andcommitted
test: add stats shape tests (150)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0cca91d commit b0a9f45

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/stats-shape.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { describe, expect, test } from "bun:test";
2+
import { Hono } from "hono";
3+
process.env.DATABASE_URL = ":memory:";
4+
const { dropRouter } = await import("../src/routes/drop");
5+
const app = new Hono();
6+
app.route("/api", dropRouter);
7+
8+
describe("Stats shape", () => {
9+
test("has exactly 3 fields", async () => {
10+
const json = await (await app.request("/api/stats")).json();
11+
expect(Object.keys(json).length).toBe(3);
12+
});
13+
test("all values are numbers", async () => {
14+
const json = await (await app.request("/api/stats")).json();
15+
for (const v of Object.values(json)) {
16+
expect(typeof v).toBe("number");
17+
}
18+
});
19+
});

0 commit comments

Comments
 (0)