prisma-fabbrica icon indicating copy to clipboard operation
prisma-fabbrica copied to clipboard

Transactional tests with jest-prisma not working in fabbrica 2.1+

Open jenrzzz opened this issue 10 months ago • 1 comments

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.

jenrzzz avatar Mar 28 '24 09:03 jenrzzz

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".

Quramy avatar Jun 14 '24 17:06 Quramy