4 ms·
Agreed - integration testing will not help you when your code is actually functional against a remote API server that is broken (or poorly documented). The ext
by daviddever23box 4y ago
Agreed - integration testing will not help you when your code is actually functional against a remote API server that is broken (or poorly documented).
The extra work required to properly separate concerns near to a foreign API surface, in my experience, pays for itself: you expected (and wrote tests for) three outcomes, and provided an observability hook for those outcomes, but a fourth raises its ugly head in real life, forcing you to revisit the API docs and add it to your mock. You add references to the API doc relative to those outcomes, and your code can be easily followed and troubleshooted by the next person. What's not to like?
I feel as if I've seen the same arguments raised over and over against mocks, all of which fall back to "I'm too lazy to maintain the state-space of unit tests", which is, quite frankly, not my problem–it's yours. Grow up and be responsible.