3 ms·
> I've spent more time fixing tests because we changed something on purpose than I ever have because they caught something we missed. That's why I love the "du
by usrusr 10y ago
> I've spent more time fixing tests because we changed something on purpose than I ever have because they caught something we missed.
That's why I love the "dump results into a single large string and compare" style of testing. Declaring a given output as known good (until proven otherwise) is a bit of a gamble, because yes, you do think harder when you are writing individual asserts. But when something changes it is very easy to tell a bad, unexpected change in the output from a good one and replacing the previous known good copy with the new one is just a few keystrokes away. A comfortable anything-to-JSON tool and a good diff viewer should be part of any testing arsenal.