Merge pull request #4 from simianhacker/testing/updateMoch
Fixed a test that was actually invalid.
This commit is contained in:
commit
6f3a174dd0
|
@ -14,7 +14,7 @@ define(function (require) {
|
|||
if (result === filter) {
|
||||
return next(filter);
|
||||
}
|
||||
throw result;
|
||||
return Promise.reject(result);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue