Skip to content

Commit

Permalink
Merge pull request #4 from simianhacker/testing/updateMoch
Browse files Browse the repository at this point in the history
Fixed a test that was actually invalid.
  • Loading branch information
spalger committed Jun 2, 2015
2 parents 446ee5b + 92147fe commit 6f3a174
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define(function (require) {
if (result === filter) {
return next(filter);
}
throw result;
return Promise.reject(result);
});
};
};
Expand Down
5 changes: 3 additions & 2 deletions test/unit/specs/components/filter_bar/generateMappingChain.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ define(function (require) {


it('should create a chaning function which calls the next function if the promise is rejected', function (done) {
var filter = {};
var mapping = sinon.stub();
mapping.returns(Promise.reject());
mapping.returns(Promise.reject(filter));
var mappingChainFn = generateMappingChain(mapping);
var next = sinon.stub();
next.returns(Promise.resolve('good'));
var chain = mappingChainFn(next);
chain({}).then(function (result) {
chain(filter).then(function (result) {
expect(result).to.be('good');
sinon.assert.calledOnce(next);
done();
Expand Down

0 comments on commit 6f3a174

Please sign in to comment.