6 ms·
> When writing unit tests I mock all the dependencies I dislike this approach because whenever any of those dependencies change, I need to change all mocks. I
by rad_gruchalski 3y ago
> When writing unit tests I mock all the dependencies
I dislike this approach because whenever any of those dependencies change, I need to change all mocks. I prefer designing my code in such a way that dependencies can be easily pulled into a test instead of mocking. It may be more work upfront but pays off in the future. Instead of spending the time to write and maintain mocks, spend the time to ensure dependencies can be pulled into a test.