yarn msw 0.13.0

latest releases: 2.3.0, 2.2.14, 2.3.0-ws.rc-6...
4 years ago

This release introduces changes to mockServiceWorker.js file. Upon updating, you will be asked to update your Service Worker file. Please follow the instructions in the browser’s console to update the file.

Features

  • Logs matched requests into browser’s console. Inspect what requests have been mocked, their handler, and the response.
  • Adds support for mocking cookies via ctx.cookie() (#101, #103).
rest.post('/login', (req, res, ctx) => {
  return res(
    ctx.cookie('auth-token', 'abc-123')
  )
})

Bug fixes

  • Prevents Service Worker to persist between different projects on the same host (#96, #99).
  • Prevents Service Worker from bypassing requests after hard reload of the page (#98, #99).

Don't miss a new msw release

NewReleases is sending notifications on new releases.