Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEli White <github@eli-white.com>2015-10-13 04:34:53 +0300
committerEli White <github@eli-white.com>2015-10-13 04:34:53 +0300
commit983450ea362877aa3259a61a9a394d84ffa193e7 (patch)
tree0338cc4b45206b6bda1b27131cee727c3b3f7044 /test
parent851c1032dcf4b15a251eef06e9f10b57a57bc31c (diff)
Make properties writable
Diffstat (limited to 'test')
-rw-r--r--test/testModules/sharedTestCases.js17
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 () {