mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Return promise from tests instead of using done callback
This commit is contained in:
parent
b41131e920
commit
8e540b52d2
1 changed files with 4 additions and 7 deletions
11
test/fixtures/__tests__/scenarioManager.js
vendored
11
test/fixtures/__tests__/scenarioManager.js
vendored
|
@ -19,13 +19,12 @@ describe('scenario manager', function () {
|
|||
indicesDelete = sinon.stub(manager.client.indices, 'delete', Promise.resolve);
|
||||
});
|
||||
|
||||
it('should be able to load scenarios', function (done) {
|
||||
manager.load('makelogs')
|
||||
it('should be able to load scenarios', function () {
|
||||
return manager.load('makelogs')
|
||||
.then(function () {
|
||||
expect(create.getCall(0).args[0].index).to.be('logstash-2015.09.17');
|
||||
expect(create.getCall(1).args[0].index).to.be('logstash-2015.09.18');
|
||||
expect(bulk.called).to.be(true);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -43,18 +42,16 @@ describe('scenario manager', function () {
|
|||
})).to.be(true);
|
||||
});
|
||||
|
||||
it('should be able to reload a scenario', function (done) {
|
||||
it('should be able to reload a scenario', function () {
|
||||
var load = sinon.stub(manager, 'load', Promise.resolve);
|
||||
var unload = sinon.stub(manager, 'unload', Promise.resolve);
|
||||
var id = 'makelogs';
|
||||
manager.reload(id).then(function () {
|
||||
return manager.reload(id).then(function () {
|
||||
expect(load.calledWith(id)).to.be(true);
|
||||
expect(unload.calledWith(id)).to.be(true);
|
||||
|
||||
load.restore();
|
||||
unload.restore();
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue