What is Source and when to use it
mainSource is a library designed to generate Mock Service Worker (MSW) request handlers from existing network data or specifications.
Instead of writing handlers manually, you can use Source to bridge the gap when:
- Migrating large existing test suites to MSW.
- Writing regression tests for network scenarios that were reproduced elsewhere (e.g., in a browser).
Source allows you to take inputs like OpenAPI documents or HAR files and transform them into reliable, reproducible MSW request handlers. This is particularly useful for replaying network-related issues by saving a browser's network activity as an *.har file and using Source to generate the corresponding handlers for your test suite.