This release introduces changes to
mockServiceWorker.js
file. Upon updating, you will be asked to update your Service Worker file. Please follow the instructions in the browser’s console to update the file.
Features
- Logs matched requests into browser’s console. Inspect what requests have been mocked, their handler, and the response.
- Adds support for mocking cookies via
ctx.cookie()
(#101, #103).
rest.post('/login', (req, res, ctx) => {
return res(
ctx.cookie('auth-token', 'abc-123')
)
})