Skip to content

Commit c73059a

Browse files
committed
feature (repository): add listPullRequestReviews
1 parent 22b889c commit c73059a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

lib/Repository.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ class Repository extends Requestable {
119119
return this._request('GET', `/repos/${this.__fullname}/pulls/${number}/files`, null, cb);
120120
}
121121

122+
/**
123+
* List the reviews of a specific pull request
124+
* @see https://developer.github.com/v3/pulls/reviews/
125+
* @param {number|string} number - the PR you wish to fetch
126+
* @param {Requestable.callback} [cb] - will receive the list of reviews from the API
127+
* @return {Promise} - the promise for the http request
128+
*/
129+
listPullRequestReviews(number, cb) {
130+
return this._request('GET', `/repos/${this.__fullname}/pulls/${number}/reviews`, null, cb);
131+
}
132+
122133
/**
123134
* Compare two branches/commits/repositories
124135
* @see https://developer.github.com/v3/repos/commits/#compare-two-commits

test/repository.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,15 @@ describe('Repository', function() {
260260
done();
261261
}));
262262
});
263+
264+
it('should list pullrequest reviews', function(done) {
265+
remoteRepo.listPullRequestReviews(454, assertSuccessful(done, function(err, reviews) {
266+
expect(reviews).to.be.an.array();
267+
expect(reviews[0]).to.have.own('body', 'Please add tests for this');
268+
269+
done();
270+
}));
271+
});
263272
});
264273

265274
describe('creating/modifiying', function() {

0 commit comments

Comments
 (0)
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