diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/testModules/sharedTestCases.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/test/testModules/sharedTestCases.js b/test/testModules/sharedTestCases.js index 7048ba8..ccbafa3 100644 --- a/test/testModules/sharedTestCases.js +++ b/test/testModules/sharedTestCases.js @@ -66,16 +66,17 @@ describe("rewire " + (typeof testEnv === "undefined"? "(node)": "(" + testEnv + expect(rewire("./moduleB.js").__with__.toString()).to.be(__with__Src); }); - it("should provide __set__ as a non-enumerable property", function () { - expect(Object.keys(rewire("./moduleA.js")).indexOf("__set__")).to.be(-1) - }); - it("should provide __get__ as a non-enumerable property", function () { - expect(Object.keys(rewire("./moduleA.js")).indexOf("__get__")).to.be(-1) - }); + ["__get__", "__set__", "__with__"].forEach(function(funcName) { + it("should provide " + funcName + " as a non-enumerable property", function () { + expect(Object.keys(rewire("./moduleA.js")).indexOf(funcName)).to.be(-1) + }); - it("should provide __with__ as a non-enumerable property", function () { - expect(Object.keys(rewire("./moduleA.js")).indexOf("__with__")).to.be(-1) + it("should provide " + funcName + " as a writable property", function () { + var obj = rewire("./moduleA.js"); + var desc = Object.getOwnPropertyDescriptor(obj, funcName); + expect(desc.writable).to.be(true); + }); }); it("should not influence other modules", function () { |