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 <noreply@paperclip.ing>
This commit is contained in:
@@ -2,6 +2,7 @@ import { describe, it, expect, vi, beforeEach } from "vitest";
|
|||||||
import { Hono } from "hono";
|
import { Hono } from "hono";
|
||||||
import type { AppEnv, StaffRow } from "../middleware/rbac.js";
|
import type { AppEnv, StaffRow } from "../middleware/rbac.js";
|
||||||
import { petsRouter } from "../routes/pets.js";
|
import { petsRouter } from "../routes/pets.js";
|
||||||
|
import { and, eq, exists, or } from "../db/index.js";
|
||||||
|
|
||||||
// ─── Mock staff fixtures ──────────────────────────────────────────────────────
|
// ─── Mock staff fixtures ──────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user