Closed kettanaito closed 2 months ago
This is a bug fix so I will merge this straight away.
This has been released in v0.28.4!
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.
Previously, throwing a
Response.erorr()
will fall through theinstanceof Response
check and be used as a mocked response. That would actually thrown an error.Now, we have an extra check for thrown responses, if they are a
Response.error()
, it will result in the network error (i.e. request error) just as it does if you dorequest.respondWith(Response.error())
.