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:
authorEli White <github@eli-white.com>2015-11-08 00:52:31 +0300
committerEli White <github@eli-white.com>2015-11-30 20:29:32 +0300
commitb752ffb9fb9aed8cdc89d3b95bf7ea3856e0ed86 (patch)
treec14a60e1b7eee23235b451fa391331cd9815b597 /testLib/sharedTestCases.js
parenta4fc3a852d1749cb6491c7a337d4ad4720248df6 (diff)
Should not blow up on modules that export primitives
Diffstat (limited to 'testLib/sharedTestCases.js')
-rw-r--r--testLib/sharedTestCases.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/testLib/sharedTestCases.js b/testLib/sharedTestCases.js
index 9fb83ed..54e4218 100644
--- a/testLib/sharedTestCases.js
+++ b/testLib/sharedTestCases.js
@@ -220,6 +220,24 @@ describe("rewire " + (typeof testEnv === "undefined"? "(node)": "(" + testEnv +
expect(rewired.__get__("someVar")).to.be("hello");
});
+ it("should not be a problem to have a module that exports a boolean", function() {
+ expect(function() {
+ var rewired = rewire("./boolean.js");
+ }).to.not.throwException();
+ });
+
+ it("should not be a problem to have a module that exports null", function() {
+ expect(function() {
+ var rewired = rewire("./null.js");
+ }).to.not.throwException();
+ });
+
+ it("should not be a problem to have a module that exports a sealed object", function() {
+ expect(function() {
+ var rewired = rewire("./sealedObject.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