← Back to context

Comment by h1fra

12 days ago

Clearly mocking DB is a footgun and it's not that hard to setup e2e test. Use TestContainer or Docker on a random port, run your API on a random port.

Every tests seeds all the data needed to run (user, org, token), it requires an initial setup but then you just reuse it everywhere, and voila. No side effects, no mock to maintain, it also test your auth and permissions, almost 1:1 with prod.

> No side effects, no mock to maintain, it also test your auth and permissions, almost 1:1 with prod.

Can also be used to test version updates of your DB.