Can we not have articles like this with blanket statements like this please? As with everything in software, no one size fits all. Mocks have their place. There are situations when the only way we can test something out is to mock out a certain function call. Sometimes our dependencies are so complex and deep that we cannot just replace it with a fake. But with a little mock we can replace a function or a class withi…
Sure, the title is clickbait. But the message seemed useful: if your test rigidly requires every call be made in exactly the way it is made now, then your test will be brittle. For a less brittle test, re-implement the functionality in a simpler form. What this article did not do was to describe the trade-off: what you give up by creating a more complicated "fake" (to use the author's term).
I am confused, wouldn't using simpler and "broader" tests miss test coverage on e.g. specific error handlers?