+15
-11
@@ -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. |
+1
-1
| { | ||
| "name": "mockery", | ||
| "version": "1.5.1", | ||
| "version": "1.6.2", | ||
| "description": "Simplifying the use of mocks with Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
47048
0.05%893
0.45%