We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0cca91d commit b0a9f45Copy full SHA for b0a9f45
tests/stats-shape.test.ts
@@ -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
15
+ for (const v of Object.values(json)) {
16
+ expect(typeof v).toBe("number");
17
+ }
18
19
+});
0 commit comments