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.14.1 to 0.14.2

5

lib/intercept.js

@@ -17,6 +17,7 @@ var RequestOverrider = require('./request_overrider'),

function add(key, interceptor) {
function add(key, interceptor, scope) {
if (! allInterceptors.hasOwnProperty(key)) {
allInterceptors[key] = [];
}
interceptor.__nock_scope = scope;
allInterceptors[key].push(interceptor);

@@ -26,2 +27,4 @@ }

function remove(interceptor) {
if (interceptor.__nock_scope.shouldPersist()) return;
var key = interceptor._key.split(' '),

@@ -28,0 +31,0 @@ u = url.parse(key[1]),

11

lib/scope.js

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

function add(key, interceptor) {
function add(key, interceptor, scope) {
if (! interceptors.hasOwnProperty(key)) {

@@ -34,3 +34,3 @@ interceptors[key] = [];

interceptors[key].push(interceptor);
globalIntercept(basePath, interceptor);
globalIntercept(basePath, interceptor, scope);
}

@@ -95,3 +95,3 @@

this.body = body;
add(key, this);
add(key, this, scope);
return scope;

@@ -309,2 +309,6 @@ }

}
function shouldPersist() {
return persist;
}

@@ -326,2 +330,3 @@ scope = {

, persist: _persist
, shouldPersist: shouldPersist
};

@@ -328,0 +333,0 @@

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

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

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

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

@@ -1584,4 +1585,8 @@ var dataCalled = false

t.ok(! scope.isDone());
t.end();
console.log('Hey');
http.get('http://persisssists.con/', function(res) {
t.ok(! scope.isDone());
t.end();
}).end();
}).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