Glossary term
What is MSW (Mock Service Worker)?
MSW stands for Mock Service Worker.
In Senior Frontend Depth
Catches network requests in tests (and dev), so real components run against fake responses.
Learn it properly · Senior Frontend DepthLesson 5: Frontend Testing Strategy: Unit, Integration, E2E and What to SkipTest what users see, not how the code is built. Mock the network, not your modules. Keep end-to-end tests for the key flows only.In Testing From Zero
A tool that fakes network responses at the request level, so your code makes real fetch calls in tests.
Learn it properly · Testing From ZeroLesson 2: Testing UI Components with Testing LibraryQueries by role, user-event, async UI, mocking the network with MSW, forms and error states.