logoalt Hacker News

emodendroketyesterday at 11:33 PM1 replyview on HN

At the end of the day I think there's nothing wrong with the tool itself. The problem is that mocking and spies make it easy to not bother properly isolating the effects of a function for testing and then you end up having a test where 95% of it is setting up an elaborate array of mocks to create the condition you wish to test, which are completely incomprehensible to the next person trying to read it.


Replies

lisbbbtoday at 2:52 AM

I used it mainly because the code I inherited was untestable as written. I made it testable via those methods. Then it got refactored.

show 1 reply