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: treat thrown responses as mocked responses #553

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Conversation

kettanaito
Copy link
Member

@kettanaito kettanaito commented Apr 17, 2024

Throwing a Response instance in a request listener is now equivalent to calling request.respondWith(thrownResponse).

interceptor.on('request', () => {
  throw new Response('hello world')
})

@kettanaito kettanaito merged commit 58a089a into main Apr 17, 2024
2 checks passed
@kettanaito kettanaito deleted the fix/throw-response branch April 17, 2024 12:38
@kettanaito
Copy link
Member Author

Released: v0.28.2 🎉

This has been released in v0.28.2!

Make sure to always update to the latest version (npm i @mswjs/interceptors@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant