3 ms·
> I've seen code with so much mocked that many unit tests failed to test anything other than behaviour of mocks. One example of this was a test that passed bec
by u801e 4y ago
> I've seen code with so much mocked that many unit tests failed to test anything other than behaviour of mocks.
One example of this was a test that passed because of the expected behavior as determined by a mock, but the code failed in the staging environment because the underlying library changed its method signature to take some parameters in a different order.
To me, this basically was a signal that that particular test and tests like it were essentially useless in determining whether the code was really in a working state.
- flippinburgers 4y agoThis is the major achilles heal of mocking that I find to be most bothersome. If at all possible I try to have at least a happy path subset of real tests hitting real 3rd party apis if I possibly can.