Packages

msw

3.0.7 · 18 Nov 2026MIT36M / weekRepositoryHomepagenpmAtom feed

Your version

0.30.0

24 Jun 2021Where it was published

0.49.3 is the newest release of 0.30.x.

In short

4 new3 fixed

Release note

Features

  • Supports generators as response resolvers (#720).

rest.get('/polling/:maxCount', function* (req, res, ctx) {
  const { count } = req.params
	let count = 0

	while (count < req.params. maxCount) {
	  yield res(ctx.json({ count }))
	}

	return res(ctx.json({ done: true }))
})
  • Adds the ctx.cookie utility to the GraphQL handlers (#763).

  • Adds a warning when running MSW on a page that’s outside of the worker’s scope (#787).

  • The worker script (mockServiceWorker.js) now contains the library version number to improve its inspection and debugging across releases (#781).

Bug fixes

  • Fixes various issues to ensure Jest 27 compatibility.

  • Fixes an issue that prevented the assignment of more narrow response types (#735).

  • Fixes an issue when parsing a GraphQL-compatible REST API request produced a parsing error during the onUnhandledRequest default behavior (#740).

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.