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

feat: support throwing responses in response resolvers #1963

Merged
merged 5 commits into from
Jan 15, 2024

Conversation

kettanaito
Copy link
Member

...resolverExtras,
request: args.request,
}) as Promise<Response>
).catch((errorOrResponse) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding this on the lowest level possible for two reasons:

  1. This way all handlers get this behavior, no matter if the handleRequest is run in the browser or Node context;
  2. This way even the direct users of the RequestHandler get this behavior, which is essential.

@kettanaito kettanaito marked this pull request as ready for review January 13, 2024 11:04
@kettanaito kettanaito changed the title feat: support throwing responses in node feat: support throwing responses in response resolvers Jan 13, 2024
@kettanaito kettanaito merged commit 39dc0e6 into main Jan 15, 2024
11 checks passed
@kettanaito kettanaito deleted the feat/throw-response branch January 15, 2024 09:59
@kettanaito
Copy link
Member Author

Released: v2.1.0 🎉

This has been released in v2.1.0!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support throwing Response in resolvers
1 participant