Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Apr 1, 2020
1 parent 1e8cd40 commit d85bc21
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ const create = (defaults: InstanceDefaults): Got => {

got.paginate = (async function * <T>(url: string | URL, options?: OptionsWithPagination<T>) {
let normalizedOptions = normalizeArguments(url, options, defaults.options);
normalizedOptions.resolveBodyOnly = false;

const pagination = normalizedOptions.pagination!;

Expand Down
10 changes: 10 additions & 0 deletions test/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,13 @@ test('throws if the `pagination` option does not have `paginate` property', asyn
message: '`options.pagination.paginate` must be implemented'
});
});

test('ignores the `resolveBodyOnly` option', withServer, async (t, server, got) => {
attachHandler(server, 2);

const items = await got.paginate.all('', {
resolveBodyOnly: true
});

t.deepEqual(items, [1, 2]);
});

0 comments on commit d85bc21

Please sign in to comment.