prismock
prismock copied to clipboard
TypeError: Cannot read properties of undefined (reading 'dmmf')
I am using Prismock and am getting this error when creating a new PrismaClient
:
FAIL src/lessons/views.test.ts
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'dmmf')
7 | export const db =
8 | globalForPrisma.prisma ||
> 9 | new PrismaClient({
| ^
10 | log:
11 | process.env.NODE_ENV === "development"
12 | ? ["query", "error", "warn"]
at Prismock.generate (../../node_modules/prismock/src/lib/client.ts:67:84)
at new Prismock (../../node_modules/prismock/src/lib/client.ts:59:12)
at Object.<anonymous> (../db/index.ts:9:3)
prismock verson: prismock@^1.31.0
prisma version: prisma@^4.15.0
Is there a version of the libraries that is tested together that is known to work?
Hello @ishaangandhi, by any chance can you submit the code you use to mock prisma?
Also, if you didn’t yet, please have a look at https://github.com/morintd/prismock/issues/895.