New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nock

Package Overview
Dependencies
Maintainers
1
Versions
438
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.13.3 to 0.13.4

7

lib/recorder.js

@@ -84,9 +84,2 @@ var http = require('http');

};
oldEnd = req.end;
req.end = function(data) {
if ('undefined' !== typeof(data)) {
req.write(data);
}
oldEnd.apply(req, arguments);
};
return req;

@@ -93,0 +86,0 @@ };

14

lib/request_overrider.js

@@ -1,2 +0,4 @@

var IncomingMessage = require('http').IncomingMessage;
var EventEmitter = require('events').EventEmitter,
IncomingMessage = require('http').IncomingMessage
;

@@ -58,2 +60,12 @@ function stringifyRequest(options, body) {

// Mock response.connection and request.connection
// Fixes: https://github.com/flatiron/nock/issues/74
if (! response.connection) {
response.connection = new EventEmitter();
}
if (! req.connection) {
req.connection = new EventEmitter();
}
options.getHeader = function(name) {

@@ -60,0 +72,0 @@ return getHeader(req, name);

{ "name" : "nock"
, "description" : "HTTP Server mocking for Node.js"
, "tags" : ["Mock", "HTTP", "testing", "isolation"]
, "version" : "0.13.3"
, "version" : "0.13.4"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com>"

@@ -27,6 +27,6 @@ , "contributors" :

{ "type" : "git"
, "url" : "http://github.com/pgte/nock.git"
, "url" : "http://github.com/flatiron/nock.git"
}
, "bugs" :
{ "url" : "http://github.com/pgte/nock/issues" }
{ "url" : "http://github.com/flatiron/nock/issues" }
, "engines" : ["node >= 0.4.10"]

@@ -33,0 +33,0 @@ , "main" : "./index"

@@ -9,3 +9,2 @@ var nock = require('../.')

tap.test("get gets mocked", function(t) {

@@ -1495,1 +1494,19 @@ var dataCalled = false

});
tap.test('post with object', function(t) {
var scope = nock('http://uri')
.post('/claim', {some_data: "something"})
.reply(200)
.log(console.log);
http.request({
hostname: 'uri',
port: 80,
method: "POST",
path: '/claim'
}, function(res) {
scope.done();
t.end();
}).end('{"some_data":"something"}');
});

@@ -26,4 +26,3 @@ var nock = require('../.')

});
req.write('ABCDEF');
req.end();
req.end('ABCDEF');
return req;

@@ -30,0 +29,0 @@ });

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