mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Fixed a test that was actually invalid.
This commit is contained in:
parent
446ee5b410
commit
92147fe269
2 changed files with 4 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue