proxyquire
Advanced tools
Comparing version 1.7.9 to 1.7.10
@@ -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': {} }); | ||
}) | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60942
1283