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:
authorJohannes Ewald <johannes.ewald@peerigon.com>2014-07-10 21:31:55 +0400
committerJohannes Ewald <johannes.ewald@peerigon.com>2014-07-10 21:31:55 +0400
commit08f12cbb785cbe77b50763c72d2a955fcee3aa56 (patch)
treeedf23d69e8d9f6295840e2c9b76c6215a9939f36 /test
parenta04a8eed1213dcb0a8f3527db878c3b1fb3e51fc (diff)
Add test to check whether __with__ ignores all returned values which are not a promise
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({});
+ });
+
});
});