Releases: mswjs/msw
v0.15.0
Changes
- The usage of
composeMocks()
function is deprecated. Please use thesetupWorker()
function instead:
- import { composeMocks, rest } from 'msw'
+ import { setupWorker, rest } from 'msw'
- const { start } = composeMocks(...)
+ const { start } = setupWorker(...)
v0.14.1
v0.14.0
This release bumps the integrity of
mockServiceWorker.js
. Please follow the error instructions in your browser's console to update the worker file to the latest version.
Breaking changes
start()
function now accepts an options object:
- start('./custom/sw/path.js', { ... })
+ start({ serviceWorker: { url: './custom/sw/path.js', options: { ... } })
Features
start
function now support aquiet
option, allowing to opt-out from the logs in browser's console (#111, #113)
start({ quiet: true })
Bug fixes
- Fixes a console error when opening the DevTools (#107, #116)
- Fixes an error message when opening DevTools (#107).
- Fixes a TypeScript types issue, which resulted into
msw
throwing a type violation when used with TypeScript v3.7 (unsupportedexport * as
syntax) (#114, #117, ). - Fixes a bug that resulted into broken URL matching when using both path parameters and wildcards in a single path.
- Fixes a bug that forbid having a one character long path parameters.
Internal
- Bundle size is 20KB smaller due to removing
ramda
dependency.
v0.13.0
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')
)
})
Bug fixes
v0.12.0
This change would bump the integrity of the Service Worker. Please follow the instructions in the respective error message in your browser's console to update the Service Worker file.
Features
Internal
- Updates the library's dependencies (#92)
v0.11.5
This release introduces changes to the
mockServiceWorker.js
file. You will be advised to update that file in your application. Please follow the instructions in the related error message in your browser's console.
Bug fixes
v0.11.4
This release introduces changes to the
mockServiceWorker.js
file. You will be advised to update that file in your application. Please follow the instructions in the related error message in your browser's console.
Bug fixes
- Fixes the Response patching scenario when performing an original
POST
request performed aGET
request instead (#77, #84)
v0.11.3
v0.11.0
Features
- The library now runs an integrity check against the Service Worker registered in your application (#81). This is necessary to warn you when the Service Worker must be updated according to the latest published release of the library. Please follow the update instructions when such occur in your browser's console.
0.9.0
Features
- Added support for Response patching
- Mocked
req
object now contains new properties:integrity
,destination
,keepalive
,bodyUsed
Bug fixes
- Fixed an issue that resulted into
req.params
beingnull
, causing an exception when trying to access an existing parameter