Does somebody know why these tests only fail somet...
# orm-help
t
Does somebody know why these tests only fail sometimes if some tests have been executed before them: https://github.com/tom-richter/prisma-jest-example There is a problem with the seeding in the beforeEach function. After all tests have been run I can see that the data from each of the three tests is in the database. However the db should have been cleared before each test. Run the commands in the Readme.md to reproduce the example. The tests are green if run individually but red if run together. This issue remains the same even if I run the tests it in sequential mode with -i.
r
@Tom 👋 Answered on Stackoverflow.
t
Ok thanks, the issue was due to that I imported a something from seed.ts. I forgot that the whole file gets executed if you import something from it. This repo contains a working setup of unit testing prisma queries with jest.
👍 1