-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
defaults
chaining actually work (#144)
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`.
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters