This is a ‘how to’ article on using Nock to mock HTTP requests during tests. When dealing with code that depends on external services maintaining test coverage and writing reliable tests can be challenging….
Source: https://codeburst.io/testing-mocking-http-requests-with-nock-480e3f164851