Manthan Mallikarjun
05/25/2020, 11:17 PMimport { prisma } from '../../../prisma/prisma';
const mock = mockDeep<typeof prisma>();
jest.mock('../../../prisma/prisma', () => mock);
it('...', () => {
mock.user.count.mockResolvedValue(2);
fn()
})
and the function call does this:
const userCount = await prisma.user.count({ where: ... });