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

Add options to the listReleases and listTags function#485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alexcanessa wants to merge1 commit intogithub-tools:master
base:master
Choose a base branch
Loading
fromalexcanessa:master
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletionslib/Repository.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -78,11 +78,12 @@ class Repository extends Requestable {
/**
* List the tags on a repository
* @see https://developer.github.com/v3/repos/#list-tags
* @param {Object} options - pagination for the list
* @param {Requestable.callback} [cb] - will receive the tag data
* @return {Promise} - the promise for the http request
*/
listTags(cb) {
return this._request('GET', `/repos/${this.__fullname}/tags`,null, cb);
listTags(options, cb = options) {
return this._request('GET', `/repos/${this.__fullname}/tags`,options !== 'function' && options, cb);
}

/**
Expand DownExpand Up@@ -793,11 +794,12 @@ class Repository extends Requestable {
/**
* Get information about all releases
* @see https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository
* @param {Object} options - pagination for the list
* @param {Requestable.callback} cb - will receive the release information
* @return {Promise} - the promise for the http request
*/
listReleases(cb) {
return this._request('GET', `/repos/${this.__fullname}/releases`,null, cb);
listReleases(options, cb = options) {
return this._request('GET', `/repos/${this.__fullname}/releases`,options !== 'function' && options, cb);
}

/**
Expand Down
2 changes: 1 addition & 1 deletiontest/markdown.spec.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,7 +37,7 @@ describe('Markdown', function() {
};
markdown.render(options)
.then(function({data: html}) {
expect(html).to.be('<p>Hello world <a href="https://github.com/github/linguist/issues/1" class="issue-link js-issue-link" data-url="https://github.com/github/linguist/issues/1" data-id="1012654" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">github/linguist#1</a> <strong>cool</strong>, and <a href="https://github.com/gollum/gollum/issues/1" class="issue-link js-issue-link" data-url="https://github.com/gollum/gollum/issues/1" data-id="183433" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#1</a>!</p>'); // eslint-disable-line
expect(html).to.be('<p>Hello world <a href="https://github.com/github/linguist/issues/1" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="1012654" data-permission-text="Issue title is private" data-url="https://github.com/github/linguist/issues/1">github/linguist#1</a> <strong>cool</strong>, and <a href="https://github.com/gollum/gollum/issues/1" class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="183433" data-permission-text="Issue title is private" data-url="https://github.com/gollum/gollum/issues/1">#1</a>!</p>'); // eslint-disable-line
done();
}).catch(done);
});
Expand Down
14 changes: 14 additions & 0 deletionstest/repository.spec.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -459,6 +459,11 @@ describe('Repository', function() {
});

it('should list tags on repo', function(done) {
const options = {
per_page: 30 //eslint-disable-line
};

remoteRepo.listTags(options, assertSuccessful(done));
remoteRepo.listTags(assertSuccessful(done));
});

Expand DownExpand Up@@ -628,6 +633,15 @@ describe('Repository', function() {
});

it('should read all releases', function(done) {
const options = {
per_page: 30 //eslint-disable-line
};

remoteRepo.listReleases(options, assertSuccessful(done, function(err, releases) {
expect(releases).to.be.an.array();
done();
}));

remoteRepo.listReleases(assertSuccessful(done, function(err, releases) {
expect(releases).to.be.an.array();
done();
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp