Last week, this great post was making rounds on HN & lobste.rs:
It describes “Testing With Expectations”, also known as “Snapshot Testing” — a powerful “thinking outside of the box” technique for writing unit-tests which suck less.
Coincidentally, I’ve implemented a tiny variation of the idea for TigerBeetle:
I don’t intend to publish this as a proper library at this point, but feel free to take a look and steal the pattern for your projects, it’s very simple!