Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 2.0.2 to 2.1.0

2

lib/proxyquire.js

@@ -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()
})
})
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