Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mockery

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockery - npm Package Compare versions

Comparing version 1.5.1 to 1.6.2

26

mockery.js

@@ -111,13 +111,2 @@ /*

// Starting in node 0.12 node won't reload native modules
// The reason is that native modules can register themselves to be loaded automatically
// This will re-populate the cache with the native modules that have not been mocked
if(originalCache) {
Object.keys(originalCache).forEach(function(k) {
if (k.indexOf('\.node') > -1 && !m._cache[k]) {
m._cache[k] = originalCache[k];
}
});
}
return originalLoader(request, parent, isMain);

@@ -142,2 +131,3 @@ }

m._cache = {};
repopulateNative();
}

@@ -177,2 +167,3 @@

m._cache = {};
repopulateNative();
}

@@ -182,2 +173,15 @@ }

/*
* Starting in node 0.12 node won't reload native modules
* The reason is that native modules can register themselves to be loaded automatically
* This will re-populate the cache with the native modules that have not been mocked
*/
function repopulateNative() {
Object.keys(originalCache).forEach(function(k) {
if (k.indexOf('\.node') > -1 && !m._cache[k]) {
m._cache[k] = originalCache[k];
}
});
}
/*
* Enable or disable warnings to the console when previously registered mocks

@@ -184,0 +188,0 @@ * and subsitutes are replaced.

{
"name": "mockery",
"version": "1.5.1",
"version": "1.6.2",
"description": "Simplifying the use of mocks with Node.js",

@@ -5,0 +5,0 @@ "keywords": [

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