Closed nbibler closed 11 months ago
For application developers, the fix here is to force NPM to update the @juramy/jest-prisma-core dependency, which it often won't want to do. You may need to blow away things (package-lock.json, node_modules, etc.) to convince it to do its job.
With the 1.7.0 release of @quramy/jest-prisma, there was a change to allow for customized jest prisma clients. This change included modification of the TypeScript type definition of
jestPrisma
to use a newly-createdJestPrisma
generic:https://github.com/Quramy/jest-prisma/blob/ea717b88b7bd3a13b79443e946072317c2f70bc0/packages/jest-prisma/src/index.ts#L7-L9
That
JestPrisma
definition comes from a different package:@quramy/jest-prisma-core
. The trouble here is that if you're upgrading an existing project, NPM has a terrible (incorrect, poor, dumb) habit of not updating sub-dependencies. This results in the 1.7.0 release of jest-prisma running against an old (in my case 1.5.0) release of jest-prisma-core. This results in the exported JestPrisma type not being a generic and causing the TypeScript system to inferjestPrisma
as anany
type.In this case, the correct solution is likely to update the jest-prisma-core sub-dependency requirement to be
^1.7.0
rather than^1.0.0
because it is no longer compatible below that.