Releases: mswjs/msw
Releases Β· mswjs/msw
v2.4.2
v2.4.2 (2024-09-04)
Bug Fixes
- cli: support windows paths in the
init
command (#2260) (ba285b8) @ivanfernandez2646 @kettanaito - use [email protected] as the minimal supported version (#2251) (6b2a7e6) @THETCR @kettanaito
- keep
graphql
import as require in cjs (#2258) (b977602) @kettanaito
v2.4.1
v2.4.0
v2.4.0 (2024-08-28)
Features
- add
HttpResponse.html()
static method (#2140, docs) (8c5580a) @scruffymongrel @kettanaito - list "graphql" as an optional peer dependency (#2187) (40b17fd) @kettanaito
- print request body in
onUnhandledRequest
message (#2227) (a2153c9) @bitttttten @kettanaito
v2.3.5
v2.3.5 (2024-08-02)
Bug Fixes
- HttpResponse: skip setting "Content-Length" if it is already set (#2228) (a0234c9) @kettanaito
v2.3.4
v2.3.3
v2.3.3 (2024-07-23)
Bug Fixes
- implement cookie persistence using
tough-cookie
(#2206) (c30613c) @kettanaito - support async generators as response resolvers (#2108) (d38fc3d) @kettanaito @jakebailey
v2.3.2
v2.3.2 (2024-07-19)
Bug Fixes
- support [email protected] (deprecate v4.7) (#2190) (7df2533) @KaiSpencer @kettanaito
v2.3.1
v2.3.1 (2024-06-01)
Bug Fixes
- preserve trailing optional path parameters (#2169) (e69bbd6) @kettanaito @KaiSpencer
v2.3.0
v2.3.0 (2024-05-08)
Warning
This release changes how MSW treats unhandled exceptions in response resolvers. Previously, they were treated as request errors. Starting with this release, unhandled resolver exceptions will be coerced to 500 Unhandled Exception
mocked error responses produced by the library. Please note that you must not intentionally throw errors in your resolvers. Please use Response.error()
to mock request/network errors. Unhandled exceptions are considered unintended and will be treated as if they happen on the actual server.
Features
- treat unhandled exceptions in handlers as 500 error responses (#2135) (5191399) @kettanaito
- prioritize the
node
export when importingmsw/node
(#2134, transitively through @mswjs/interceptors). - add a new
unhandledException
event (#2135, docs).
server.events.on('unhandledException', ({ request, error }) => {
console.log('%s %s errored! See details below.', request.method, request.url)
console.error(error)
})
Bug Fixes
- Disposable: make the ".dispose()" method synchronous (#2144) (686d3d6) @kettanaito
v2.2.14
v2.2.14 (2024-04-17)
Bug Fixes
- preserve search params in "onUnhandledRequest" messages (#2128) (64bcae7) @nagadevkrishna @kettanaito
- give
node
export condition higher priority (#2134) (f948d13) @phryneas