github mswjs/msw v0.40.0

latest releases: v2.2.14, v2.2.13, v2.2.12...
23 months ago

v0.40.0 (2022-05-17)

Breaking changes

  • Returning undefined, or early returns, from response resolvers, now does not perform request as-is, and is instead treated as a handler that didn't do anything. Please return req.passthrough() if you wish to bypass a request.
rest.get('/resource', (req, res, ctx) => {
// I want to perform this intercepted request as-is.
-  return
+  return req.passthrough()
})

Features

  • add "unhandledException" life-cycle event (#1199) (5c90799)
  • improve PathParams type to support interface (#1219) (b70266f)
  • rename "DefaultRequestBody" to "DefaultBodyType" (53aa3a1)
  • add "req.passthrough" (#1204) (4e1b1ad)
  • add service worker scope and worker script URL to "Mocking enabled" message (#1172) (ab3d399)
  • set "typescript" optional peer dependency to 4.2.x (#985) (b1004a6)

Bug Fixes

  • setupWorker: warn on multiple "worker.start" and "worker.stop" calls (#1238) (cfe0709)
  • remove console.log from "setRequestCookies" (6f7ed98)
  • set "credentials" to "same-origin" for "ClientRequest" (#1159) (c3cd80a)

Don't miss a new msw release

NewReleases is sending notifications on new releases.