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).