The death of mocks by Testcontainers

This page summarizes the projects mentioned and recommended in the original post on dev.to

CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Kindly note I would mostly skip the setup required to run the NestJs application, here's a link to the Github Repository.

  2. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  3. testcontainers-node

    Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

    Writing tests can often feel like a daunting task, especially when you find yourself juggling mocks for internal and external services. Flaky tests, unrealistic mocks, and the constant fear of “what if this breaks in production?” can make the process incredibly stressful. I recently had to write integration tests for a service built with NestJs and having to mock the database layer (repository) didn't sit right with me as it felt like I was testing a facade rather than the real thing. Now, don’t get me wrong—mocks are great and have their place in testing. But in this scenario, I wanted to ensure my code worked seamlessly in a production-like environment. So, I did what any developer would do: I reached out to my manager for advice. His suggestion? Testcontainers. It was a game-changer. With Testcontainers, I was able to spin up lightweight, disposable containers for services like PostgreSQL, Redis, and more—giving me a reliable, production-like testing environment right from my local machine. No more “living a lie” with overly simplistic mocks.

  4. Nest

    A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀

    Writing tests can often feel like a daunting task, especially when you find yourself juggling mocks for internal and external services. Flaky tests, unrealistic mocks, and the constant fear of “what if this breaks in production?” can make the process incredibly stressful. I recently had to write integration tests for a service built with NestJs and having to mock the database layer (repository) didn't sit right with me as it felt like I was testing a facade rather than the real thing. Now, don’t get me wrong—mocks are great and have their place in testing. But in this scenario, I wanted to ensure my code worked seamlessly in a production-like environment. So, I did what any developer would do: I reached out to my manager for advice. His suggestion? Testcontainers. It was a game-changer. With Testcontainers, I was able to spin up lightweight, disposable containers for services like PostgreSQL, Redis, and more—giving me a reliable, production-like testing environment right from my local machine. No more “living a lie” with overly simplistic mocks.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Dynamic NestJS Listeners: Discover the Power of Lazy Loading

    3 projects | dev.to | 13 Oct 2024
  • An example of a simple update of NestJS-mod libraries

    4 projects | dev.to | 15 Aug 2024
  • Next.js vs Nest.js: What to Choose in 2025?

    3 projects | dev.to | 13 Mar 2025
  • I made MCP (Model Context Protocol) alternative solution, for OpenAI and all other LLMs, that is cheaper than Anthropic Claude

    5 projects | dev.to | 8 Mar 2025
  • ReactPress—A free CMS and blog system using Next.js.

    3 projects | dev.to | 7 Mar 2025