Comparing version 0.15.1 to 0.15.2
var EventEmitter = require('events').EventEmitter, | ||
http = require('http'), | ||
propagate = require('propagate'), | ||
OutgoingMessage = http.OutgoingMessage, | ||
@@ -152,4 +153,5 @@ ClientRequest = http.ClientRequest; | ||
if (interceptor.options.allowUnmocked) { | ||
ClientRequest.call(req, options, cb); | ||
oldEnd.call(req, requestBody); | ||
var newReq = new ClientRequest(options, cb); | ||
propagate(newReq, req); | ||
newReq.end(requestBody); | ||
return; | ||
@@ -156,0 +158,0 @@ } |
{ "name" : "nock" | ||
, "description" : "HTTP Server mocking for Node.js" | ||
, "tags" : ["Mock", "HTTP", "testing", "isolation"] | ||
, "version" : "0.15.1" | ||
, "version" : "0.15.2" | ||
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>" | ||
@@ -33,2 +33,5 @@ , "contributors" : | ||
, "main" : "./index" | ||
, "dependencies": { | ||
"propagate": "0.2.x" | ||
} | ||
, "devDependencies": { | ||
@@ -35,0 +38,0 @@ "tap": "0.4.x", |
@@ -1684,2 +1684,19 @@ var nock = require('../.') | ||
}).end(); | ||
}); | ||
tap.test('allow unmocked post with json data', function(t) { | ||
var scope = nock('https://httpbin.org', { allowUnmocked: true }). | ||
get("/abc"). | ||
reply(200, "Hey!"); | ||
var options = { | ||
method: 'POST', | ||
uri: 'https://httpbin.org/post', | ||
json: { some: 'data' } | ||
}; | ||
mikealRequest(options, function(err, resp, body) { | ||
t.equal(200, resp.statusCode) | ||
t.end(); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73761
2155
1
+ Addedpropagate@0.2.x
+ Addedpropagate@0.2.2(transitive)