From 11e74f598638ea8fb4af5967a7b56943aa5d1aa9 Mon Sep 17 00:00:00 2001 From: brandon Date: Mon, 26 Aug 2019 22:29:43 -0400 Subject: [PATCH 1/2] implement getCombinedStatus --- lib/Repository.js | 11 +++++++++++ test/repository.spec.js | 11 +++++++++++ 2 files changed, 22 insertions(+) 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/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)); }); From 295a16da04b42c1fda872ca4609ec31e5152492a Mon Sep 17 00:00:00 2001 From: brandon feldkamp Date: Wed, 28 Aug 2019 20:33:51 -0400 Subject: [PATCH 2/2] update editLabel test Signed-off-by: brandon feldkamp --- test/issue.spec.js | 1 + 1 file changed, 1 insertion(+) 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(); 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