Socket
Socket
Sign inDemoInstall

nock

Package Overview
Dependencies
0
Maintainers
1
Versions
422
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.0 to 0.6.1

4

lib/intercept.js

@@ -23,2 +23,3 @@ var path = require('path')

var interceptor;
var thisInterceptor;

@@ -131,3 +132,2 @@ for(var i = 0; i < interceptors.length; i++) {

}).join('');
body = undefined; // we don't need the request body buffers any more

@@ -355,3 +355,3 @@ interceptors = interceptors.filter(function(interceptor) {

} else {
return httpRequest.apply(http, arguments);
return httpsRequest.apply(https, arguments);
}

@@ -358,0 +358,0 @@ };

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

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

@@ -750,4 +750,2 @@ var nock = require('../.')

tap.test("can use hostname instead of host", function(t) {
var dataCalled = false
var scope = nock('http://www.google.com')

@@ -764,12 +762,5 @@ .get('/')

res.on('end', function() {
t.ok(dataCalled);
scope.done();
t.end();
});
res.on('data', function(data) {
dataCalled = true;
t.ok(data instanceof Buffer, "data should be buffer");
t.equal(data.toString(), "Hello World!", "response should match");
});
});

@@ -781,4 +772,2 @@

tap.test("can take a port", function(t) {
var dataCalled = false
var scope = nock('http://www.myserver.com:3333')

@@ -796,12 +785,5 @@ .get('/')

res.on('end', function() {
t.ok(dataCalled);
scope.done();
t.end();
});
res.on('data', function(data) {
dataCalled = true;
t.ok(data instanceof Buffer, "data should be buffer");
t.equal(data.toString(), "Hello World!", "response should match");
});
});

@@ -808,0 +790,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc