-
-
Notifications
You must be signed in to change notification settings - Fork 467
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
feat(openapi-fetch): allow usage of custom Request class #1907
Conversation
🦋 Changeset detectedLatest commit: 92a069e The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding! Looks great and happy to merge, but let’s release this as a patch instead.
@@ -282,6 +282,27 @@ describe("request", () => { | |||
expect(headers.get("cookie")).toEqual("session=1234"); | |||
}); | |||
|
|||
test("uses provided Request class", async () => { | |||
// santity check to make sure the profided fetch function is actually called | |||
expect.assertions(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Good test, and helpful comment! (Reading the test it almost looks like there’s not an assertion, but there is).
Co-authored-by: Drew Powers <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
Changes
Request
classRequest
andResponse
#1563How to Review
CustomRequest
class and inlined the business logic from the constructorChecklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)