Supercharge your Tests with Snapshot Testing - Giacomo Cavalieri | Code BEAM Europe 2024
This talk was recorded at Code BEAM Europe in October 2024. If you’re curious about our upcoming event, check https://codebebeameurope.com
Unit tests are a fundamental defence line to prevent subtle bugs from sneaking into our code base. The problem is that writing them can sometimes feel like a tedious, repetitive and error-prone chore.
That’s when snapshot testing comes into play. It makes an alluring promise: completely rid the developer of the boring task of having to manually write and manage unit tests’ assertions! While it may sound too good to be true, there’s no magic trick and we’ll discover the ins and outs of snapshot testing in Gleam: what it is, how it works and, most importantly, how to use it effectively.
Comments welcome! View the code-sync tag for more Code Sync talks!
4 Likes
lpil
April 19, 2025, 5:34pm
2
This was a fantastic talk. The ideas expressed here have greatly reduced the amount of time it takes to develop features in the Gleam compiler codebase, largely through reducing time-expensive chore work with test management.