All Posts

Snapshot Testing Is Hard -- Pitfalls To Avoid

Snapshot testing is an extremely fast way to add regression testing to an existing project. You simply take some example inputs and then snapshot the resulting outputs. From then on, you can have a high degree of confidence that any changes you make have not affected backwards compatibility (as this would have been detected as a change in a snapshot). However there are many pitfalls you can run into as I found when writing cupaloy, a snapshot testing library for Go.