Adam
07/02/2021, 12:00 AMdescribe ) would start up its own isolated database/schema and its own base data to perform the tests, then destroy it after being completed.
With the nature of Prisma requiring the DB_URL outside of the application context, I haven't found a good way of implementing this model.
Is there a different way beyond running test in a synchronous fashion?
One of my thoughts (for postgres) was to create databases with a UUID so the connection string would be like <postgresql://localapp:password@localhost:5432/${UUID}> which with postgres these can reside all in the same DB server. Then drop them on completion/failure of the test. But I don't see a way of doing that.Pierre Ortega
07/02/2021, 12:58 AMPierre Ortega
07/02/2021, 12:58 AMjest-environment-node so it generates a new schema on psql per file
https://github.com/PierreAndreis/yulp/blob/main/prisma/prisma-test-environment.js
https://github.com/PierreAndreis/yulp/blob/main/jest.config.js#L6Pierre Ortega
07/02/2021, 1:00 AMRyan
07/02/2021, 5:26 AMAdam
07/02/2021, 12:26 PM