Skip to content

Commit f2cfa93

Browse files
committed
Re-added test and default value setting for options
1 parent 9f558aa commit f2cfa93

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/Repository.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class Repository extends Requestable {
187187
* @return {Promise} - the promise for the http request
188188
*/
189189
listCommits(options, cb) {
190+
options = options || {};
190191
if (typeof options === 'function') {
191192
cb = options;
192193
options = {};

test/repository.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ describe('Repository', function() {
132132
}));
133133
});
134134

135+
it('should list commits with null options', function(done) {
136+
remoteRepo.listCommits(null, assertSuccessful(done, function(err, commits) {
137+
expect(commits).to.be.an.array();
138+
expect(commits.length).to.be.above(0);
139+
140+
expect(commits[0]).to.have.own('commit');
141+
expect(commits[0]).to.have.own('author');
142+
143+
done();
144+
}));
145+
});
146+
135147
it('should list commits with all options', function(done) {
136148
const since = new Date(2015, 0, 1);
137149
const until = new Date(2016, 0, 20);

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