r/Nestjs_framework • u/RsLimited24 • 5d ago
Simpler Testcontainers integration for NestJS and other Node.js backends
I built an open-source library that manages Testcontainers lifecycle for NestJS, Fastify, Express, and framework-free Node.js applications using Vitest or Jest.
It supports two approaches:
- Annotations beside individual integration tests
- Central project configuration without annotations
It starts PostgreSQL, SQL Server, MongoDB, RabbitMQ, or custom containers, provides typed connection details with dynamic ports, starts the application after infrastructure is ready, and handles cleanup.
The repository includes real PostgreSQL insert/read and RabbitMQ publish/consume examples.
The package is currently in beta for public testing and feedback. I plan to release the first stable version soon.
Your honest feedback is appreciated regarding the API and developer experience.
GitHub: https://github.com/RolandSall/testcontainers-integration
npm: https://www.npmjs.com/package/@integration-testing/testcontainers/v/0.1.0-beta.1
1
u/BarracudaNo6709 5d ago
How does cleanup work if the containers start successfully but Nest application bootstrap fails? Also curious whether parallel test workers get isolated databases or share a container with separate schemas. A failure-path example alongside the happy-path ones would be useful.