proxyquire
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -157,3 +157,3 @@ 'use strict' | ||
// best we can. | ||
if (!this._preserveCache) { | ||
if (!this._preserveCache || this._noCallThru) { | ||
return path.resolve(path.dirname(baseModule), pathToResolve) | ||
@@ -160,0 +160,0 @@ } |
{ | ||
"name": "proxyquire", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Proxies nodejs require in order to allow overriding dependencies during testing.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,7 +18,5 @@ 'use strict' | ||
describe('When resolving foo that requires stubbed /not/existing/bar.json with noCallThru', function () { | ||
var foo | ||
describe('When resolving foo that requires stubbed /not/existing/bar.json with @noCallThru', function () { | ||
it('resolves foo with stubbed bar', function () { | ||
foo = proxyquire(fooPath, { | ||
var foo = proxyquire(fooPath, { | ||
'/not/existing/bar.json': { config: 'bar\'s config', '@noCallThru': true } | ||
@@ -29,1 +27,12 @@ }) | ||
}) | ||
describe('When resolving foo that requires stubbed /not/existing/bar.json with noCallThru()', function () { | ||
it('resolves foo with stubbed bar', function () { | ||
proxyquire.noCallThru() | ||
var foo = proxyquire(fooPath, { | ||
'/not/existing/bar.json': { config: 'bar\'s config' } | ||
}) | ||
assert.equal(foo.config, 'bar\'s config') | ||
proxyquire.callThru() | ||
}) | ||
}) |
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
65001
1387