Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit08f12cb

Browse files
committed
Add test to check whether __with__ ignores all returned values which are not a promise
1 parenta04a8ee commit08f12cb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

‎test/__with__.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,21 @@ describe("__with__", function() {
176176
expect(moduleFake.getReference()).to.eql({});
177177
});
178178

179+
it("should ignore any returned value which doesn't provide a then()-method",function(){
180+
expect(moduleFake.getValue()).to.be(0);
181+
expect(moduleFake.getReference()).to.eql({});
182+
183+
moduleFake.__with__({
184+
myValue:2,
185+
myReference:newObj
186+
})(function(){
187+
return{};
188+
});
189+
190+
expect(moduleFake.getValue()).to.be(0);
191+
expect(moduleFake.getReference()).to.eql({});
192+
});
193+
179194
});
180195

181196
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp