Mirfayz
PPrisma
•Created by Mirfayz on 7/30/2024 in #help-and-questions
How to test a prisma call that uses `connectOrCreate`? (using vitest ideally)
Hey all!
I'm trying to write a unit test for the following prisma call in my Next.js app:
Basically, I want to test this case:
"It should connect a participant if an existing identifier is provided or create a participant if an identifier doesn't exist in the db'"
Is there any way of testing this? Maybe, mocking a DB state and using it to provide state or smt?
Would appreciate your help, thank you in advance!1 replies