-
-
Notifications
You must be signed in to change notification settings - Fork 752
Closed
Description
May be I am missing something but when enabling recorder, no requests are intercepted by nock.
mocha test :
describe("nock recorder issue", function () {
var nock = require('nock'), // v0.50.0
request = require('request'); // v2.36.0
nock.disableNetConnect();
it('works without recorder', function (done) {
expected = nock('http://localhost').get('/').reply(200);
request.get('http://localhost/', function () {
expected.done();
done();
});
})
it('should work with recorder (but fails)', function (done) {
nock.recorder.rec();
expected = nock('http://localhost').get('/').reply(200);
request.get('http://localhost/', function (error) {
// when recorder is on, requests are not intercepted
// and *real requests are emitted*
// even though nock.disableNetConnect() is used
// this one throws ECONNREFUSED because no server is
// running on localhost
console.log(error);
expected.done();
done();
});
})
});
Metadata
Metadata
Assignees
Labels
No labels