Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nock

Package Overview
Dependencies
Maintainers
1
Versions
436
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nock - npm Package Compare versions

Comparing version 0.15.1 to 0.15.2

6

lib/request_overrider.js
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();
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc