From 434c7b94e2c6022679027ab935bf1ba8e37cdea1 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Thu, 14 May 2026 07:24:52 +0000 Subject: [PATCH] fix: export named DB utilities in petsExtendedFields test mock pets.ts imports pets, appointments, and, eq, exists, or directly from "../db". The vi.mock factory only returned getDb, causing vitest to throw "No 'pets' export is defined" and 7 tests to get 400 instead of 201/200. Fix adds the missing named exports to the mock return object. Co-Authored-By: Claude Opus 4.7 --- apps/api/src/__tests__/petsExtendedFields.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/api/src/__tests__/petsExtendedFields.test.ts b/apps/api/src/__tests__/petsExtendedFields.test.ts index 5106a62..a013d88 100644 --- a/apps/api/src/__tests__/petsExtendedFields.test.ts +++ b/apps/api/src/__tests__/petsExtendedFields.test.ts @@ -161,6 +161,12 @@ vi.mock("../db", () => { update: () => makeUpdateChainable(), delete: () => makeDeleteChainable(), }), + pets, + appointments, + and, + eq, + exists, + or, }; });