yarn msw 0.16.2

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

Features

  • GraphQL requests are now being printed into browser’s console using a proper format (operation name / response status) (#161, #174)
  • Each custom request handler can have its own log function that controls what and how gets printed into browser’s console for introspection:
// my-handler.js
export const myHandler = () => {
  return {
    log(req, res, handler) {
      console.log('%s %s', req.method, req.url.href)
    }
  }
}

The information available in the log function:

  • req, intercepted request instance;
  • res, resolved mocked response object;
  • handler, exact request handler that captured this request.

Bug fixes

  • Fixes an issue that resulted into a request body with the Content-Type: application/json to be unparsed in req.body reference of the request handler (#171, #172).

Don't miss a new msw release

NewReleases is sending notifications on new releases.