Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit16724f5

Browse files
committed
feature (repository): add listPullRequestReviews
1 parent22b889c commit16724f5

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
returnthis._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+
returnthis._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,null,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)

[8]ページ先頭

©2009-2025 Movatter.jp