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

mockery

Package Overview
Dependencies
Maintainers
4
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.7.0 to 2.0.0

19

mockery.js

@@ -159,2 +159,3 @@ /*

});
removeParentReferences();
m._cache = originalCache;

@@ -175,2 +176,3 @@ originalCache = null;

if (options.useCleanCache && originalCache) {
removeParentReferences();
m._cache = {};

@@ -335,2 +337,19 @@ repopulateNative();

/**
* Remove references to modules in the mockery cache from
* their parents' children.
*/
function removeParentReferences() {
Object.keys(m._cache).forEach(function(k){
if (k.indexOf('\.node') === -1) {
// don't touch native modules, because they're special
var mod = m._cache[k];
var idx = mod.parent.children.indexOf(mod);
if (idx > -1) {
mod.parent.children.splice(idx, 1);
}
}
});
}
// Exported functions

@@ -337,0 +356,0 @@ exports.enable = enable;

2

package.json
{
"name": "mockery",
"version": "1.7.0",
"version": "2.0.0",
"description": "Simplifying the use of mocks with Node.js",

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

# Mockery - Simplifying the use of mocks with Node.js
[![Build Status](https://secure.travis-ci.org/mfncooper/mockery.png)](http://travis-ci.org/mfncooper/mockery)
[![Build Status](https://secure.travis-ci.org/mfncooper/mockery.svg)](http://travis-ci.org/mfncooper/mockery)

@@ -5,0 +5,0 @@ If you've tried working with mocks in Node.js, you've no doubt discovered that

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