Skip to content

Commit

Permalink
Merge pull request #10 from Polymer/github-api-paging-fix
Browse files Browse the repository at this point in the history
index github api paging at 1, not 0
  • Loading branch information
FredKSchott authored Oct 11, 2017
2 parents 54d79b9 + 2722aca commit e1fa31c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class GitHubConnection {
const allRepos: GitHubRepoData[] = [];
let pageRepos: GitHubRepoData[] = [];
const pageSize = 50;
let page = 0;
let page = 1;
let isOrg = true;

do {
Expand Down
8 changes: 7 additions & 1 deletion src/test/_util/mock-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function setup() {
nock('https://api.github.com')
.persist()
.get('/orgs/polymerelements/repos')
.query({page: 0, per_page: 50, access_token: testApiToken})
.query({page: 1, per_page: 50, access_token: testApiToken})
.reply(
200,
[
Expand Down Expand Up @@ -63,6 +63,12 @@ export function setup() {
],
{Status: '200 OK'});

nock('https://api.github.com')
.persist()
.get('/orgs/polymerelements/repos')
.query({page: 2, per_page: 50, access_token: testApiToken})
.reply(200, [], {Status: '200 OK'});

nock('https://api.github.com')
.persist()
.get('/repos/PolymerElements/paper-appbar/git/refs/heads/ABCDEFGH')
Expand Down

0 comments on commit e1fa31c

Please sign in to comment.