From 21981fbdc4094c5b946d6318e86e085cf426c679 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Thu, 21 May 2026 02:09:15 +0000 Subject: [PATCH] fix(GRO-1365): add missing imports for and/eq/exists/or in test The vi.mock factory uses db.and/eq/exists/or from the imported module, but TypeScript's module-level import binding (const declarations) can't be referenced inside the async factory before initialization. Adding top-level imports from "../db/index.js" and using them directly in the mock return fixes the TDZ error. Co-Authored-By: Paperclip --- apps/api/src/__tests__/petsExtendedFields.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/api/src/__tests__/petsExtendedFields.test.ts b/apps/api/src/__tests__/petsExtendedFields.test.ts index bd9da1b..3425234 100644 --- a/apps/api/src/__tests__/petsExtendedFields.test.ts +++ b/apps/api/src/__tests__/petsExtendedFields.test.ts @@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; import { Hono } from "hono"; import type { AppEnv, StaffRow } from "../middleware/rbac.js"; import { petsRouter } from "../routes/pets.js"; +import { and, eq, exists, or } from "../db/index.js"; // ─── Mock staff fixtures ──────────────────────────────────────────────────────