diff --git a/lib/Repository.js b/lib/Repository.js index 16733e67..3908775c 100644 --- a/lib/Repository.js +++ b/lib/Repository.js @@ -234,6 +234,17 @@ class Repository extends Requestable { return this._request('GET', `/repos/${this.__fullname}/commits/${sha}/statuses`, null, cb); } + /** + * Get the combined view of commit statuses for a particular sha, branch, or tag + * @see https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + * @param {string} sha - the sha, branch, or tag to get the combined status for + * @param {Requestable.callback} cb - will receive the combined status + * @returns {Promise} - the promise for the http request + */ + getCombinedStatus(sha, cb) { + return this._request('GET', `/repos/${this.__fullname}/commits/${sha}/status`, null, cb); + } + /** * Get a description of a git tree * @see https://developer.github.com/v3/git/trees/#get-a-tree diff --git a/test/issue.spec.js b/test/issue.spec.js index 3a407811..7e9af51e 100644 --- a/test/issue.spec.js +++ b/test/issue.spec.js @@ -241,6 +241,7 @@ describe('Issue', function() { it('should update a label', (done) => { let label = { color: '789abc', + name: createdLabel }; expect(createdLabel).to.be.a.string(); diff --git a/test/repository.spec.js b/test/repository.spec.js index e248faca..3de25bef 100644 --- a/test/repository.spec.js +++ b/test/repository.spec.js @@ -255,6 +255,17 @@ describe('Repository', function() { })); }); + it('should get combined view of commit statuses for a SHA from a repo', function(done) { + remoteRepo.getCombinedStatus(v10SHA, assertSuccessful(done, function(err, combinedStatusesView) { + expect(combinedStatusesView.sha).to.equal(v10SHA); + expect(combinedStatusesView.state).to.equal('success'); + expect(combinedStatusesView.statuses[0].context).to.equal('continuous-integration/travis-ci/push'); + expect(combinedStatusesView.total_count).to.equal(1); + + done(); + })); + }); + it('should get a SHA from a repo', function(done) { remoteRepo.getSha('master', '.gitignore', assertSuccessful(done)); }); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy