prisma-fabbrica
prisma-fabbrica copied to clipboard
Transactional tests with jest-prisma not working in fabbrica 2.1+
The change in https://github.com/Quramy/prisma-fabbrica/pull/257 appears to have broken transactional tests with jest-prisma. Some factory generations seem to be picking up something other than the jestPrisma client that wraps them in a transaction.
https://github.com/Quramy/prisma-fabbrica/pull/257 appears to have broken transactional tests with jest-prisma
🤔
Setup script for jest-prisma uses the following initialize
function ( which is different from initialize function exposed in generated factory code). This function uses "singleton" Prisma Client.
https://github.com/Quramy/prisma-fabbrica/blob/b8684760509cac86b5906a9e419997713026505a/packages/prisma-fabbrica/src/initialize.ts#L54-L60
I don't know what causes "Some factory generations seem to be picking up something other than the jestPrisma client".