This commit is contained in:
raulb 2017-07-05 18:06:07 +02:00
Родитель 244518e934
Коммит 9f4c18d8af
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E980774E7D035F37
2 изменённых файлов: 31 добавлений и 0 удалений

Просмотреть файл

@ -18,6 +18,16 @@ function* pipelineRepository (client, pipelineID) {
})
}
function* getDyno (client, appID, dynoID) {
return client.request({
path: `/apps/${appID}/dynos/${dynoID}`,
headers: {
Authorization: `Bearer ${client.options.token}`,
Accept: VERSION_HEADER
}
})
}
function* githubArchiveLink (client, user, repository, ref) {
return client.request({
host: KOLKRABBI,
@ -128,6 +138,7 @@ module.exports = {
configVars,
createSource,
createTestRun,
getDyno,
githubArchiveLink,
latestTestRun,
testNodes,

Просмотреть файл

@ -37,6 +37,26 @@ describe('heroku-api', function () {
})
})
describe('#getDyno', function () {
it('returns dyno information', function* () {
const appID = '123-456-67-89'
const dynoID = '01234567-89ab-cdef-0123-456789abcdef'
const dyno = {
id: dynoID,
attach_url: 'rendezvous://rendezvous.runtime.heroku.com:5000/{rendezvous-id}',
app: { id: appID }
}
const api = nock(`https://api.heroku.com`)
.get(`/apps/${appID}/dynos/${dynoID}`)
.reply(200, dyno)
const response = yield herokuAPI.getDyno(new Heroku(), appID, dynoID)
expect(response).to.deep.eq(dyno)
api.done()
})
})
describe('#githubArchiveLink', function () {
it('gets a GitHub archive link', function* () {
const { user, repository } = ['heroku', 'heroku-ci']