github icon indicating copy to clipboard operation
github copied to clipboard

Add pagination to search endpoints

Open alaycock opened this issue 6 years ago • 0 comments

Changes:

  • Updated the jsdoc to correctly document the Github.search function.
  • If a page option is passed into _requestAllPages, it will only fetch that single page, instead of attempting to fetch all of the pages.
  • Removed the results parameter from _requestAllPages, since that is only meant to be used internally anyway. It's trivial to re-introduce, so let me know if this makes sense to do, since this could break some backwards compatibility if folks are using an unsupported argument.
  • Added a test for pagination, and a new fixture for that test. Fixed a number of other fixtures that didn't seem to have the correct page number.
  • Changed the fixtures to use rawHeader instead of header, since the tests were not paginating. This was introduced when the spec for fixture files changed from nock@7 to nock@8.

Let me know if this is the right approach. I've only run tests for the search endpoints (due to lack of access to the testing repo), so I'm not sure if this is going to introduce errors elsewhere.

Closes #406 This could be a potential solution for #460, although introducing a limit could be an alternate solution.

alaycock avatar Sep 06 '19 22:09 alaycock