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
diff options
context:
space:
mode:
Diffstat (limited to 'testLib/sharedTestCases.js')
-rw-r--r--testLib/sharedTestCases.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/testLib/sharedTestCases.js b/testLib/sharedTestCases.js
index 6cd9b2e..9b709c2 100644
--- a/testLib/sharedTestCases.js
+++ b/testLib/sharedTestCases.js
@@ -388,10 +388,13 @@ module.exports = function () {
it("should be possible to set a const variable", function () {
var constModule = rewire("./constModule");
+ var varNames = Object.keys(constModule);
- "abcdefghij".split("").forEach(letter => {
- constModule.__set__(letter, "this has been changed"); // should not throw
- expect(constModule[letter]()).to.equal("this has been changed");
+ expect(varNames.length).to.be.greaterThan(0);
+
+ varNames.forEach(varName => {
+ constModule.__set__(varName, "this has been changed"); // should not throw
+ expect(constModule[varName]()).to.equal("this has been changed");
});
});