mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
use bluebird delay for sleep method
This commit is contained in:
parent
db5e279f5f
commit
45bce9db2b
1 changed files with 4 additions and 9 deletions
|
@ -48,16 +48,11 @@ define(function (require) {
|
|||
},
|
||||
|
||||
sleep: function sleep(sleepMilliseconds) {
|
||||
var self = this;
|
||||
self.log('... sleep(' + sleepMilliseconds + ') start');
|
||||
var log = this.log;
|
||||
log('... sleep(' + sleepMilliseconds + ') start');
|
||||
|
||||
var promise = new Promise(function (resolve, reject) {
|
||||
setTimeout(function () {
|
||||
self.log('... sleep(' + sleepMilliseconds + ') end');
|
||||
resolve({});
|
||||
}, sleepMilliseconds);
|
||||
});
|
||||
return promise;
|
||||
return Promise.resolve().delay(sleepMilliseconds)
|
||||
.then(function () { log('... sleep(' + sleepMilliseconds + ') end'); })
|
||||
},
|
||||
|
||||
screenshotError: function screenshotError(testSubName, reason) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue