diff options
Diffstat (limited to 'testLib')
-rw-r--r-- | testLib/objectRestOperator.js | 2 | ||||
-rw-r--r-- | testLib/objectSpreadOperator.js | 1 | ||||
-rw-r--r-- | testLib/sharedTestCases.js | 12 |
3 files changed, 15 insertions, 0 deletions
diff --git a/testLib/objectRestOperator.js b/testLib/objectRestOperator.js new file mode 100644 index 0000000..4a2753d --- /dev/null +++ b/testLib/objectRestOperator.js @@ -0,0 +1,2 @@ +let { ...a } = {}; +module.exports = a; diff --git a/testLib/objectSpreadOperator.js b/testLib/objectSpreadOperator.js new file mode 100644 index 0000000..83b7414 --- /dev/null +++ b/testLib/objectSpreadOperator.js @@ -0,0 +1 @@ +module.exports = { ...{} }; diff --git a/testLib/sharedTestCases.js b/testLib/sharedTestCases.js index b6caf6a..991453b 100644 --- a/testLib/sharedTestCases.js +++ b/testLib/sharedTestCases.js @@ -238,6 +238,18 @@ module.exports = function () { }).to.not.throwException(); }); + it("should not be a problem to have a module that uses object spread operator", function() { + expect(function() { + var rewired = rewire("./objectSpreadOperator.js"); + }).to.not.throwException(); + }); + + it("should not be a problem to have a module that uses object rest operator", function() { + expect(function() { + var rewired = rewire("./objectRestOperator.js"); + }).to.not.throwException(); + }); + it("should not influence the original require if nothing has been required within the rewired module", function () { rewire("./emptyModule.js"); // nothing happens here because emptyModule doesn't require anything expect(require("./moduleA.js").__set__).to.be(undefined); // if restoring the original node require didn't worked, the module would have a setter |