In our case, mocking the network makes sense IMO. You are writing a service that connects with other services, but you don't want to run the whole infrastructure while developing that service. We stub the responses coming from other services using nock.
I agree with you that mocking a lot of stuff for unit testing is a code smell. But in our case, this is an integration test for the whole service itself.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I don't like that unit testing requires to restructor code or even mocking.
It's like testing stuff that wouldn't be there to test in the first place. :/
In our case, mocking the network makes sense IMO. You are writing a service that connects with other services, but you don't want to run the whole infrastructure while developing that service. We stub the responses coming from other services using
nock
.I agree with you that mocking a lot of stuff for unit testing is a code smell. But in our case, this is an integration test for the whole service itself.