yarn msw 0.26.0

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

This release introduces changes to the mockServiceWorker.js file. Please follow the instructions in the browser to update the worker file. Thank you.

Features

  • Adds support for GraphQL upload and multipart data operations (#215, #543).
  • Adds delay modes: “real” and “infinite” (#538). Supports infinite loading.
ctx.delay() // random realistic response time
ctx.delay('real') // the same as `ctx.delay()`
ctx.delay('infinite') // infinite response time
ctx.delay(50) // explicit response delay (50ms)
  • Displays [MSW] Mocking disabled message when calling worker.stop(). (#485, #493).

Bug fixes

  • Fixes an issue that resulted in theFailed to construct 'Response': The status provided (0) is outside the range [200, 599]. exception caused by an opaque response on the page (#529, #564). MSW will now skip opaque responses during the life-cycle events handling. You will not get the response:bypass invoked upon an opaque response.
  • Fixes an issue that resulted in an exception being thrown when handling subsequent requests in Safari (#558, #565).
  • Fixes an issue when the ExecutionResult of graphql was not compatible with ctx.data and ctx.errors utilities (#522, #542).
  • Fixes an issue that resulted in the MSW worker handling unrelated message event originating from other tools (#551).

Internal

  • Updates dependencies to their latest versions.
  • Consistently uses self instead of this in the worker script (#568).
  • Ensures that MSW doesn’t handle events originating from unrelated workers (#551).

Don't miss a new msw release

NewReleases is sending notifications on new releases.