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:
Diffstat (limited to 'test')
-rw-r--r--test/__with__.test.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/__with__.test.js b/test/__with__.test.js
index 3cd4b57..c4f7539 100644
--- a/test/__with__.test.js
+++ b/test/__with__.test.js
@@ -176,6 +176,21 @@ describe("__with__", function() {
expect(moduleFake.getReference()).to.eql({});
});
+ it("should ignore any returned value which doesn't provide a then()-method", function () {
+ expect(moduleFake.getValue()).to.be(0);
+ expect(moduleFake.getReference()).to.eql({});
+
+ moduleFake.__with__({
+ myValue: 2,
+ myReference: newObj
+ })(function () {
+ return {};
+ });
+
+ expect(moduleFake.getValue()).to.be(0);
+ expect(moduleFake.getReference()).to.eql({});
+ });
+
});
});