Closed martinheidegger closed 8 years ago
This doesn't seem to be getting all results. For instance, I have 631 starred repos, but getAllPages
returns 200:
"use strict";
var Assert = require("assert");
var Client = require("./../lib/index");
var testAuth = require("./../test_auth.json");
var github = new Client({});
github.authenticate({
type: "oauth",
token: testAuth["token"]
});
github.getAllPages(github.activity.getStarredRepos, { per_page: 100 }, function(err, res) {
console.log(res.length);
Assert.ok(res.length == 621);
});
Thank you for second-check it. I seem to have refactored it a little too much. The new commit i just pushed seems to mitigate former issues.
Added this useful helper method that allows people to quickly get the content of all pages from a github-client method.