ReadableStream
support, ESM-compatibility, and countless bug fixes.
Codemod supports a mostly automated MSW v2 upgrade experience. This page provides tips and resources you may need for a successful migration.
Getting started
Migration Steps
1
Installation
2
Run codemods
Inside your project’s root directory, run the MSW v2 upgrade recipe:
3
Fix false negatives
The upgrade recipe does not change the signatures of MSW handlers, if they were called using a custom factory function, for example to provide more type-safety or else. For example, the following code will only be partially updated:Additionally, if you were using
req.body
in your interceptors, this codemod will blindly assume you want await request.json()
instead of any other type. You will have to correct that manually.