rewire
Advanced tools
Comparing version 1.1.0 to 1.1.1
##Changelog | ||
###v1.1.1 | ||
- Fixed bug with modules that had a comment on the last line | ||
###v1.1.0 | ||
@@ -4,0 +7,0 @@ - Added Coffee-Script support |
@@ -40,3 +40,4 @@ var Module = require("module"), | ||
// We append our special setter and getter. | ||
appendix = "module.exports.__set__ = " + __set__.toString() + "; "; | ||
appendix = "\n"; | ||
appendix += "module.exports.__set__ = " + __set__.toString() + "; "; | ||
appendix += "module.exports.__get__ = " + __get__.toString() + "; "; | ||
@@ -43,0 +44,0 @@ |
{ | ||
"name" : "rewire", | ||
"version" : "1.1.0", | ||
"version" : "1.1.1", | ||
"description" : "Dependency injection for node.js applications", | ||
@@ -5,0 +5,0 @@ "keywords" : [ |
"use strict"; // run code in ES5 strict mode | ||
var someVar; | ||
// Comment on file end. Hope this won't break anything |
@@ -148,2 +148,8 @@ // Don't run code in ES5 strict mode. | ||
}); | ||
it("should not be a problem to have a comment on file end", function () { | ||
var rewired = rewire("./emptyModule.js"); | ||
rewired.__set__("someVar", "hello"); | ||
expect(rewired.__get__("someVar")).to.be("hello"); | ||
}); | ||
it("should not influence the original require if nothing has been required within the rewired module", function () { | ||
@@ -150,0 +156,0 @@ rewire("./emptyModule.js"); // nothing happens here because emptyModule doesn't require anything |
Sorry, the diff of this file is not supported yet
128956
1593