Skip to content

Commit

Permalink
test: adapt for @octokit/rest
Browse files Browse the repository at this point in the history
Turns out that the `per_page` & `page` params are missing in [routes.json](https://github.com/octokit/rest.js/blob/master/lib/routes.json#L1682-L1687), which means, with the previous implementations, they have been ignored!

The new implementation automatically passes all remaining options as query parameter (for `GET` requests) so it works anyway.

So tl;dr: the new release actually fixed a bug, getting the stats will be more performant now, as it gets 100 results instead of 30
  • Loading branch information
gr2m committed Jan 29, 2018
1 parent 3872ec6 commit 5bf1c31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/plugins/stats.test.js
Expand Up @@ -19,7 +19,7 @@ describe('stats', function () {
.defaultReplyHeaders({'Content-Type': 'application/json'})
.post('/installations/1/access_tokens').reply(200, {token: 'test'})
.get('/app/installations?per_page=100').reply(200, [{id: 1, account: {login: 'testing'}}])
.get('/installation/repositories').reply(200, {repositories: [
.get('/installation/repositories?per_page=100').reply(200, {repositories: [
{private: true, stargazers_count: 1},
{private: false, stargazers_count: 2}
]})
Expand Down

0 comments on commit 5bf1c31

Please sign in to comment.