I'm trying to run some fairly straight forward tes...
# orm-help
r
I'm trying to run some fairly straight forward tests against my graphql backend, but though queries work, mutations fail with
Project not found: 'backend$test'
- this is a snippet of the code (again, queries work just fine) https://git.io/fhzoX - anyone seen this kind of error (or know of good testing patterns - without mocks)
h
Hi, Have you deployed the prisma datamodel to test endpoint you are using?
I guess you changed the prisma endpoint but forgot to run deploy
r
Yeah - just realised! 😕
👍 1
😅 1
I've run
prisma deploy --env-file .env.test
and the test works as expected. Still mentally connecting the bits!
h
Yes, if you create a new stage or service it is completely isolated from the others
So it needs a deploy
r
Is there a way (from something like Jest) that I can empty out all the database (leaving the tables in place) as a setup test process?
Though, I guess it could just be a pre-test hook if I can't.
h
You can do it using prisma reset --env .env.test
in a pretest npm script
r
ta.