msw
3.0.7 · 18 Nov 2026MIT36M / weekRepositoryHomepagenpmAtom feed
0.49.3 is the newest release of 0.18.x.
In short
1 new2 fixed3 changed
Release note
Features
Adds support for declaring runtime request handlers (#128, #187):
.use()to prepend any request handlers. Any prepended request handlers take priority over existing ones, if their predicate match..restoreHandlers()to mark any used one-time request handlers as unused, allowing them to affect network again..resetHandlers()to remove any request handlers added on runtime. Optionally accepts a list of next request handlers that replace the initial handlers passed tosetupServer/setupWorkercall.
Adds support for one-time request handlers using
res.once(). Such handles will respond with a given mocked response only once upon request match:
rest.get('/books', (req, res, ctx) => {
return res.once(ctx.json([1, 2, 3]))
})Bug fixes
TS7016: Could not find a declaration file for module 'cookie'
Fixes an outdated GitHub repository link in the
mockServiceWorker.jsfile.
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.