Open hadeelfouad opened 1 year ago
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.
Tried the following code to mock my PrismaClient using JavaScript
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.