nestjs / docs.nestjs.com

The official documentation https://docs.nestjs.com 📕
MIT License
1.2k stars 1.75k forks source link

Request for adding TestContainers Recipe in the Nestjs docs #3122

Open MacMacky opened 1 month ago

MacMacky commented 1 month ago

Is there an existing issue that is already proposing this?

I'm submitting a...

Is your feature request related to a problem? Please describe it.

I would like to add a new recipe for testing specifically using TestContainers. This would be helpful for engineers who work with multiple services, such as databases, cloud services, or brokers, and would like to set up these services using containers for testing, as they are easier to set up and cost-effective.

Describe the solution you'd like.

I’m happy to contribute by adding a new recipe on how to configure and stop/terminate the containers. This would benefit users who prefer to run integration or end-to-end tests.

Teachability, documentation, adoption, migration strategy.

I believe it would align with the existing "Testing Fundamentals" structure, but with added code examples for setting up and tearing down TestContainers using a database. We could also provide a working code sample in the repository.

What is the motivation/use case for changing the behavior?

Adding a Recipe on How to Integrate with TestContainers using Nestjs when testing will help engineers who primarily work with databases/cloud services/brokers set up these services using containers instead of using those actual services, saving $$$ and time since we're just using containers that are disposable and cheap

kamilmysliwiec commented 1 month ago

I'd love to see this recipe in the docs. PRs are more than welcome 🙏