News for hackers. Stuff that matters.
Re:Testcontainers by globular-toast on Wednesday February 28, 2024 @10:07AM (#39538892)
Then you're testing the implementation and need to change the test and mocks every time the implementation changes.

Making stuff quicker is a good reason to mock stuff. So is not hitting real network services. But, in all cases, the best thing is to avoid mocking if possible.

Re:Testcontainers by paxys on Wednesday February 28, 2024 @10:35AM (#39539278)
Why do you care how Cosmos or DynamoDB or any other dependency is implemented? You only need to mock the interface to these services. Their internal code can change every day without affecting your tests.

And if you want to catch potential changes in Cosmos that modify the behavior of your own service, that isn't the purpose of unit tests.

Re:Testcontainers by simonw on Wednesday February 28, 2024 @03:28PM (#39543064)
I want to be able to update to the latest version of DynamoDB (or something else - not every dependency is as stable as DynamoDB) and know that all of my code that calls it still works.