By popular demand, this “cheat sheet” is loosely based on the little recap/summary boxes from the end of each chapter. The idea is to provide a few reminders, and links to the chapters where you can find out more to jog your memory. I hope you find it useful!
unittestis fine, options like
Greencan also offer some advantages.
Automate your staging and production environments:
Be reminded of the reason we write tests in the first place:
And with those objectives in mind, think of different types of tests, and the tradeoffs between them:
If you do find yourself writing tests with lots of mocks, and they feel painful, remember “listen to your tests”—ugly, mocky tests may be trying to tell you that your code could be simplified.