Integration tests with Deno and drizzle
Hello,
I'm wondering what's the best approach when dealing with integration tests using PostgreSQL+ Drizzle. I'm using deno and I get an error each time I try to access my database as I don't close the connection because I rely on the global db instance (which I believe seems to be the pattern illustrated in the docs?). If I close the connection after a test, the other tests just break with . If I don't close the connection Deno gives me the
treatment.
I don't use vitest, just the Deno default test runner. Passing the db instance to each function looks like an awful solution to me, I don't really know if there is a better solution? I see that the drizzle driver can be mocked, but that does not solve my global db instance problem. Could the singleton pattern be relevant for my use case?
1 Reply
😅