Skip to content

Commit ba74ee2

Browse files
committed
test(repository): add specs to test the new listCommitsOnPR function
1 parent 95fb236 commit ba74ee2

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/repository.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,24 @@ describe('Repository', function() {
173173
}));
174174
});
175175

176+
it('should list commits on a PR with no options', function(done) {
177+
const PR_NUMBER = 588;
178+
remoteRepo.listCommitsOnPR(PR_NUMBER, assertSuccessful(done, function(err, commits) {
179+
expect(commits).to.be.an.array();
180+
expect(commits.length).to.be.equal(2);
181+
182+
let message1 = 'fix(repository): prevents lib from crashing when not providing optional arguments';
183+
expect(commits[0].author).to.have.own('login', 'hazmah0');
184+
expect(commits[0].commit).to.have.own('message', message1);
185+
186+
let message2 = 'test(repository): updates test to use promise instead of callback';
187+
expect(commits[1].author).to.have.own('login', 'hazmah0');
188+
expect(commits[1].commit).to.have.own('message', message2);
189+
190+
done();
191+
}));
192+
});
193+
176194
it('should get the latest commit from master', function(done) {
177195
remoteRepo.getSingleCommit('master', assertSuccessful(done, function(err, commit) {
178196
expect(commit).to.have.own('sha');

0 commit comments

Comments
 (0)