Skip to content

v0.19.0

Compare
Choose a tag to compare
@kettanaito kettanaito released this 04 Jun 13:26

Features

  • The library now defers all the client-side requests that happen between calling worker.start() and successful worker activation. This eliminates race condition between the two, and now comes as the default behavior. (#190, #196)

The behavior of deferring requests can be configured using the waitUntilReady: boolean option on worker.start():

import { setupWorker, rest } from 'msw'

const worker = setupWorker(/* request handlers */)

worker.start({
  // You can opt-out of the deferred network requests behavior.
  waitUntilReady: false
})