Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make defaults chaining actually work (v9 regression) #144

Merged
merged 1 commit into from
May 9, 2022

Commits on Apr 29, 2022

  1. fix: make defaults chaining actually work

    The README says:
    
    > A defaulted `fetch` will also have a `.defaults()` method, so they can
    > be chained.
    
    But this didn't really work, because while the `defaults` method was
    placed on the `defaulted` fetch, a chained defaulted fetch would just
    call the original fetch function directly instead of the intermediate
    function.
    
    This PR makes chaining actually work and adds a test.
    
    Also, it fixes the previous test, which wasn't actually verifying that
    the correct request headers were received because it used the nock API
    incorrectly: the option is `reqheaders` not `reqHeaders`.
    glasser committed Apr 29, 2022
    Configuration menu
    Copy the full SHA
    e0d8699 View commit details
    Browse the repository at this point in the history