1 | const api = require('./heroku-api')
|
2 | const wait = require('co-wait')
|
3 |
|
4 | function * 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 |
|
12 | module.exports = {
|
13 | waitForStates
|
14 | }
|