We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent369f2d4 commit7e25edeCopy full SHA for 7e25ede
test/rewire.test.js
@@ -16,6 +16,14 @@ describe("rewire", function () {
16
fs.renameSync(fakeNodeModules,path.resolve(__dirname,"testModules/node_modules"));
17
}
18
});
19
+it("should keep not leak globals",function(){
20
+// This test should run first, as the global space may be already polluted if
21
+// require("../") is run before this test.
22
+varoriginalGlobalKeys=Object.keys(global),
23
+rewire=require("../"),
24
+emptyModule=rewire("./testModules/emptyModule.js");
25
+expect(Object.keys(global)).to.eql(originalGlobalKeys);
26
+});
27
it("should pass all shared test cases",function(){
28
require("./testModules/sharedTestCases.js");
29
@@ -31,7 +39,4 @@ describe("rewire", function () {
31
39
32
40
expect(coffeeModule.readFileSync()).to.be("It works!");
33
41
34
-it("should keep src variable in function scope",function(){
35
-expect(global.src).to.be(undefined);
36
-});
37
42