Comparing version 1.5.1 to 1.6.2
@@ -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": [ |
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
47048
893