3 ms·
If you are testing the externalities, they aren't unit tests, but integration tests. The better advice is: continue to isolate unit tests away from real depend
by kromem 5y ago
If you are testing the externalities, they aren't unit tests, but integration tests.
The better advice is: continue to isolate unit tests away from real dependencies, and ALSO have integration tests that test the way the package connects to dependencies (and the other packages in the software dependent on it).
- wtetzner 5y agoI would argue that if you need mocks, the code isn’t well suited to unit testing and you’re better off with integration tests. If you want to unit test it, then refactor in such a way that you no longer need mocks.