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

17 lines
381 B
TypeScript

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