Comparing version 2.1.4 to 2.1.5
Changelog | ||
--------- | ||
### 2.1.5 | ||
- Fix issues with reverting nested properties | ||
### 2.1.4 | ||
- Fix problems when an illegal variable name is used for a global | ||
### 2.1.3 | ||
@@ -55,2 +61,2 @@ - Fix shadowing of internal `module`, `exports` and `require` when a global counterpart exists [jhnns/rewire-webpack#6](https://github.com/jhnns/rewire-webpack/pull/6) | ||
- Moved browserify-middleware from `rewire.browserify` to `rewire.bundlers.browserify` | ||
- Reached stable state :) | ||
- Reached stable state :) |
@@ -16,3 +16,3 @@ /** | ||
arguments.src = ""; | ||
arguments.snapshot = {}; | ||
arguments.revertArgs = []; | ||
@@ -24,2 +24,3 @@ if (typeof arguments[0] === "object" && arguments.length === 1) { | ||
} | ||
arguments.revertArgs[0] = {}; | ||
for (arguments.varName in arguments.env) { | ||
@@ -29,3 +30,3 @@ if (arguments.env.hasOwnProperty(arguments.varName)) { | ||
arguments.src += arguments.varName + " = arguments.env." + arguments.varName + "; "; | ||
arguments.snapshot[arguments.varName] = eval(arguments.varName); | ||
arguments.revertArgs[0][arguments.varName] = eval(arguments.varName); | ||
} | ||
@@ -38,3 +39,3 @@ } | ||
arguments.src = arguments.varName + " = arguments.varValue;"; | ||
arguments.snapshot[arguments.varName] = eval(arguments.varName); | ||
arguments.revertArgs = [arguments.varName, eval(arguments.varName)]; | ||
} else { | ||
@@ -46,7 +47,7 @@ throw new TypeError("__set__ expects an environment object or a non-empty string as a variable name"); | ||
return function (snapshot) { | ||
module.exports.__set__(snapshot); | ||
}.bind(null, arguments.snapshot); | ||
return function (revertArgs) { | ||
__set__.apply(null, revertArgs); | ||
}.bind(null, arguments.revertArgs); | ||
} | ||
module.exports = __set__; |
{ | ||
"name": "rewire", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "Easy dependency injection for node.js unit testing", | ||
@@ -36,5 +36,5 @@ "keywords": [ | ||
"scripts": { | ||
"test": "node node_modules/mocha/bin/mocha -R spec", | ||
"test": "mocha -R spec --check-leaks", | ||
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22914
19
287
0