cal.pub0.org/tests/libs/__mocks__/prismaMock.ts

19 lines
392 B
TypeScript

import { beforeEach, vi } from "vitest";
import { mockDeep, mockReset } from "vitest-mock-extended";
import type { PrismaClient } from "@calcom/prisma";
vi.mock("@calcom/prisma", () => ({
default: prisma,
prisma,
availabilityUserSelect: vi.fn(),
userSelect: vi.fn(),
}));
beforeEach(() => {
mockReset(prisma);
});
const prisma = mockDeep<PrismaClient>();
export default prisma;