proxyquire
Advanced tools
Comparing version 2.1.2 to 2.1.3
@@ -157,14 +157,10 @@ 'use strict' | ||
// best we can. We also need to check if the relative module has @noCallThru. | ||
var resolvedPath = path.resolve(path.dirname(baseModule), pathToResolve) | ||
var moduleNoCallThru | ||
var resolvedPath | ||
if (hasOwnProperty.call(stubs, pathToResolve)) { | ||
if (hasOwnProperty.call(stubs, pathToResolve) && stubs[pathToResolve]) { | ||
// pathToResolve is currently relative on stubs from _withoutCache() call | ||
moduleNoCallThru = hasOwnProperty.call(stubs[pathToResolve], '@noCallThru') ? stubs[pathToResolve]['@noCallThru'] : undefined | ||
resolvedPath = path.resolve(path.dirname(baseModule), pathToResolve) | ||
} else { | ||
resolvedPath = path.resolve(path.dirname(baseModule), pathToResolve) | ||
if (hasOwnProperty.call(stubs, resolvedPath)) { | ||
// after _withoutCache() alters stubs paths to be absolute | ||
moduleNoCallThru = hasOwnProperty.call(stubs[resolvedPath], '@noCallThru') ? stubs[resolvedPath]['@noCallThru'] : undefined | ||
} | ||
} else if (hasOwnProperty.call(stubs, resolvedPath) && stubs[resolvedPath]) { | ||
// after _withoutCache() alters stubs paths to be absolute | ||
moduleNoCallThru = hasOwnProperty.call(stubs[resolvedPath], '@noCallThru') ? stubs[resolvedPath]['@noCallThru'] : undefined | ||
} | ||
@@ -171,0 +167,0 @@ if (!this._preserveCache || this._noCallThru || moduleNoCallThru) { |
{ | ||
"name": "proxyquire", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Proxies nodejs require in order to allow overriding dependencies during testing.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,2 +13,4 @@ 'use strict' | ||
proxyquire(fooPath, { path: null }) | ||
}, function (error) { | ||
return error.code === 'MODULE_NOT_FOUND' | ||
}) | ||
@@ -15,0 +17,0 @@ }) |
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
67174
561548
1411