diff options
author | Johannes Ewald <johannes.ewald@peerigon.com> | 2014-07-10 21:31:55 +0400 |
---|---|---|
committer | Johannes Ewald <johannes.ewald@peerigon.com> | 2014-07-10 21:31:55 +0400 |
commit | 08f12cbb785cbe77b50763c72d2a955fcee3aa56 (patch) | |
tree | edf23d69e8d9f6295840e2c9b76c6215a9939f36 /test | |
parent | a04a8eed1213dcb0a8f3527db878c3b1fb3e51fc (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.js | 15 |
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({}); + }); + }); }); |