fix(tests): use AppEnv type for clients test Hono app

Properly type the test app with AppEnv so c.set("staff", ...) satisfies
TypeScript's strict overload check. Fixes TS2769 typecheck failure on CI.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Flea Flicker
2026-03-27 01:57:07 +00:00
parent 1e86f1c088
commit d1970bd3e2
+3 -2
View File
@@ -1,5 +1,6 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { Hono } from "hono";
import type { AppEnv } from "../middleware/rbac.js";
// ─── Mock data ────────────────────────────────────────────────────────────────
@@ -104,9 +105,9 @@ vi.mock("@groombook/db", () => {
const { clientsRouter } = await import("../routes/clients.js");
const app = new Hono();
const app = new Hono<AppEnv>();
app.use("*", async (c, next) => {
c.set("staff", { id: "staff-uuid-1", role: "manager" } as never);
c.set("staff", { id: "staff-uuid-1", role: "manager" } as AppEnv["Variables"]["staff"]);
await next();
});
app.route("/clients", clientsRouter);