From d1970bd3e228442e8ad05b377d2f641829bb8e36 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Fri, 27 Mar 2026 01:57:07 +0000 Subject: [PATCH] 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 --- apps/api/src/__tests__/clients.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/api/src/__tests__/clients.test.ts b/apps/api/src/__tests__/clients.test.ts index ff7b2d3..8d42b78 100644 --- a/apps/api/src/__tests__/clients.test.ts +++ b/apps/api/src/__tests__/clients.test.ts @@ -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(); 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);