DEV Community

Discussion on: How to convince my colleagues about the importance of automated testing

namirsab profile image
Namir Author

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.