NodeJS: Supercharge Your Integration Tests with Vitest, Testcontainers and PGlite
summary
Shows how to speed up and harden Node.js integration tests using Testcontainers (TypeScript API for managing Docker environments), PGlite (a tiny, WebAssembly-compiled Postgres), and Vitest (including its test isolation and new fixture/infrastructure management features). Presents concrete techniques to cut CI run times and make integration tests more reliable.
AI-written summary · about
chapters (14)
- 0:00Integration tests intro
- 3:10Integration tests focus
- 4:36Testcontainers for Node.js
- 7:03Custom Testcontainers plugin
- 9:33Demo: Vitest + GRPC mock
- 11:39Vitest global setup
- 14:30PGlite: lightweight PostgreSQL
- 16:13Testcontainers vs PGlite
- 18:43Vitest performance
- 21:11Simplify tests with fixtures
- 22:34Advanced Vitest fixtures
- 27:56Best practices
- 28:39Measure test performance
- 29:42Q&A
related talks
31mGreat Expectations – Understanding nodejs Testing Frameworks
27mAnatomy of a Test Runner: What Vitest Keeps Getting Right
43mAshes to Ashes, Specs to Specs: A Farewell to Old Testing Tools
57mScaling the Testing Pyramid in JavaScript
20mVitest: testing DX reimagined
30mUsing Docker & Compose to Simplify Integration Testing
24mIntegration Testing Made Easy: Leveraging Testcontainers and
48mModern Testing Patterns
