Closed braxnu closed 7 years ago
You have to use Nock in your test file, not your gulpfile. Something you should have done in the first place anyways.
Please read it again. This is what I do.
By Nock, I meant Express. You have to have everything in your test file, or imported into it. This is a good thing. Your gulpfile should not be intertwined with testing logic.
That's a fair point. Thanks
Not sure if this is a real issue or is it me doing it wrong.
In my case, gulp starts the express server and then runs mocha to test the route handlers. Some of the route handlers issue their own request as their purpose is a sort of a proxy service.
Before, in the mocha specs I was able to use nock to mock the requests issued by route handlers. Since mocha is now run in a separate process, nock does not affect these requests (as they still run in the "main" process).
Is it me doing it wrong or quite unexpected change of behaviour?