I like this, it mirrors my practice. I don’t think this is shared widely, based both on tests I’ve seen in the wild, and the fact that I had to work it out for myself the hard way.
One nuance I’d like to add is: every bit of output data you assert about should be derived from something in your test setup. This is about legibility and comprehension. “X in -> Y out, because of Z”. When you use hidden values, all you see in the test is “Y out, because Z”
#tdd #unittesting
https://jaywhy13.hashnode.dev/tests-you-love-to-read-write-and-change