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)
Bug fixes
- Fixes an issue that resulted in the
Failed 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 theresponse: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
ofgraphql
was not compatible withctx.data
andctx.errors
utilities (#522, #542). - Fixes an issue that resulted in the MSW worker handling unrelated message event originating from other tools (#551).