UNPKG

330 BJavaScriptView Raw
1const api = require('./heroku-api')
2const wait = require('co-wait')
3
4function * waitForStates (states, testRun, { heroku }) {
5 while (!states.includes(testRun.status)) {
6 testRun = yield api.testRun(heroku, testRun.pipeline.id, testRun.number)
7 yield wait(1000)
8 }
9 return testRun
10}
11
12module.exports = {
13 waitForStates
14}