diff --git a/source/create.ts b/source/create.ts index 7c31ae0d7..a59f2cba7 100644 --- a/source/create.ts +++ b/source/create.ts @@ -239,7 +239,9 @@ const create = (defaults: InstanceDefaults): Got => { return; } - if (optionsToMerge !== undefined) { + if (optionsToMerge === result.request.options) { + normalizedOptions = result.request.options; + } else if (optionsToMerge !== undefined) { normalizedOptions = normalizeArguments(undefined, optionsToMerge, normalizedOptions); } diff --git a/test/pagination.ts b/test/pagination.ts index cdc9b66c8..4aad683d4 100644 --- a/test/pagination.ts +++ b/test/pagination.ts @@ -333,7 +333,7 @@ test('allowGetBody sends json payload with .paginate()', withBodyParsingServer, t.deepEqual(results, [1, 2, 3]); }); -test.failing('`hooks` are not duplicated', withBodyParsingServer, async (t, server, got) => { +test('`hooks` are not duplicated', withBodyParsingServer, async (t, server, got) => { let page = 1; server.get('/', (_request, response) => { response.end(JSON.stringify([page++]));