Better and cleaner assertions using snapshots

Assertions are a crucial part of tests. Even though most developers realize this, they often are rather limited. After all, they can be cumbersome to write. For example, if you’re running E2E tests for an endpoint that returns a list of 10 elements with 10 properties each - which isn’t even near the amount of data that often flows through production systems - you already have to write assertions for 100 properties....

May 19, 2023 · 7 min · redzimski.dev

Testing the integration with a database the right way - introduction to Testcontainers

Persisting data in a database is one of the most common tasks that applications have to perform, and it’s so crucial that without it the rest of the app is often useless. It’s also an area that’s notoriously hard to test. In this blog post, you can read about several ways of doing it and some problems they come with. Finally, I’m going to share with you how I use Testcontainers to test the integration with a database and why I think it’s the best way to do it....

December 4, 2022 · 7 min · redzimski.dev