Hacker News new | ask | show | jobs
by MuffinFlavored 2418 days ago
I would go with `nock` rather than spinning up a mock server: https://github.com/nock/nock
1 comments

nock will intercept http requests in the same node process it is used in. Here the test (and the mock) are in a different container and thus process. It won't catch them. Unless it is possible to actually spin up a server using nock and I've missed it? In which case I agree, custom code is not needed.