Open
Description
Tried the following code to mock my PrismaClient using JavaScript
import { PrismaClient } from '@prisma/client';
import { mockDeep } from 'jest-mock-extended';
export const createDatabase = () => {
return mockDeep(PrismaClient.prototype);
}
And it was able to successfully mock all models functions but not any functions starting with $ (for example $transaction, $on, etc.) it still calls the real function even though the PrismaClient is a MockObject.
Metadata
Assignees
Labels
No labels
Activity