If have unit tests written with jest and typescrip...
# orm-help
j
If have unit tests written with jest and typescript, i have set my env to test, but how can i tell prisma to use the test db?(because if cannot write js in a .prisma file.(Normally i would check it with process.env etc)
n
If I understand this correctly you don’t want to mock PrismaClient : https://www.prisma.io/docs/guides/testing/unit-testing#mocking-the-prisma-client And instead would want to make actual db calls while testing?
a
Hey @Jannik Köster! I recently set up unit tests that connected to a live db. Since Prisma grabs environment config from a few discreet file locations (you can see here), you can’t have one
.env
file per environment The only way I could get this to work nicely was to export the database url within node, as part of a `beforeEach`/`beforeAll` in Jest