Fun & Sane Node.js TDD: Supercharge Postgres Tests with PGLite, Drizzle & Vitest

Fun & Sane Node.js TDD: Supercharge Postgres Tests with PGLite, Drizzle & Vitest Hey everyone! Let’s talk about testing in Node.js, specifically when databases get involved. Unit tests? Absolutely essential for checking your functions in isolation. But let’s be real, at some point, you need to know if your code actually plays nice with a real database, message queue, or whatever external service it relies on. Mocking everything can feel like building a house of cards, fragile, prone to hiding nasty bugs that only surface when things interact for real....

May 4, 2025

Integration Testing Node.js Postgres interaction Like You Mean It (with Vitest & Testcontainers)

Integration Testing Node.js Postgres interaction Like You Mean It (with Vitest & Testcontainers) Look, unit tests are great for checking isolated logic. But eventually, you need to know if your code actually works with a real database, message queue, or whatever external service you depend on. Mocking everything is fragile and often hides bugs that only show up when things get real. Shared dev databases? A recipe for flaky tests and stepping on colleagues’ toes....

Apr 15, 2025