You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

proxyquire

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxyquire - npm Package Compare versions

Comparing version

to
1.7.10

14

lib/proxyquire.js

@@ -187,9 +187,11 @@ 'use strict';

var stubIds = Object.keys(stubs).map(function (stubPath) {
return resolve.sync(stubPath, {
basedir: dirname(id),
extensions: Object.keys(require.extensions),
paths: Module.globalPaths
})
try {
return resolve.sync(stubPath, {
basedir: dirname(id),
extensions: Object.keys(require.extensions),
paths: Module.globalPaths
})
} catch (_) {}
});
var ids = [id].concat(stubIds);
var ids = [id].concat(stubIds.filter(Boolean));

@@ -196,0 +198,0 @@ ids.forEach(function (id) {

{
"name": "proxyquire",
"version": "1.7.9",
"version": "1.7.10",
"description": "Proxies nodejs require in order to allow overriding dependencies during testing.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -103,3 +103,11 @@ /*jshint asi:true*/

});
it('silences errors when stub lookups fail', function() {
var proxyquire = require('..').noPreserveCache();
assert.doesNotThrow(function () {
proxyquire.load('./samples/cache/foo', { './does-not-exist': {} });
})
});
});
});