Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jenrzzz opened this issue Mar 28, 2024 · 1 comment
Open

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

jenrzzz opened this issue Mar 28, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@jenrzzz
Copy link

jenrzzz commented Mar 28, 2024

The change in #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.

@Quramy
Copy link
Owner

Quramy commented Jun 14, 2024

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

// NOTE:
//
// This static initialize and reset functions are exported only for scripts/jest-prisma/setup.ts
export function initialize(options: InitializeOptions) {
setClient(options.prisma);
resetSequence();
}

I don't know what causes "Some factory generations seem to be picking up something other than the jestPrisma client".

@Quramy Quramy added the help wanted Extra attention is needed label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants