I wouldn't say its bug but maybe its a bit strange behaviour.
Compare two cases
it("should just pass", done => {
nock("http://test.com")
.post("")
.reply(200, function(url, data) {
return {};
});
got.post("http://test.com", {});
done();
});
it("should just pass", done => {
nock("http://test.com")
.post("/")
.reply(200, function(url, data) {
return {};
});
got.post("http://test.com", {});
done();
});
The first one fails because got( https://www.npmjs.com/package/got) makes request to http://test.com/ while nock is watching connections to http://test.com. But shouldn't those be equal from nock perspective?
I wouldn't say its bug but maybe its a bit strange behaviour.
Compare two cases
The first one fails because got( https://www.npmjs.com/package/got) makes request to http://test.com/ while nock is watching connections to http://test.com. But shouldn't those be equal from nock perspective?