Re:Ask HN: What made you change your mind about a programmin...
by stevesmithwick on Monday March 04, 2019 @05:00AM
(#19300068)
A good use of mocks/spies is if you need to test a side-effect. For instance: did your code call that service with the right parameters?
This isn't to say that integration tests aren't great, too. They all tell different stories. I like unit tests, as they force me to think about modules as units. If a unit is hard to test or brittle, it may need more attention to its design.