Mock by intercepting requests on the network level. Seamlessly reuse the same mock definition for testing, development, and debugging. Dedicated layer

API mocking of the next generation

submited by
Style Pass
2022-01-14 07:30:07

Mock by intercepting requests on the network level. Seamlessly reuse the same mock definition for testing, development, and debugging.

Dedicated layer of requests interception at your disposal. Keep your application's code and tests unaware whether something is mocked or not.

Request the same production resources and test the actual behavior of your app. Augment an existing API, or design it as you go, when there is none.

Use Express-like routing syntax to capture outgoing requests. Parameters, wildcards, regular expressions—mocking has never been easier.

I found MSW and was thrilled that not only could I still see the mocked responses in my DevTools, but that the mocks didn't have to be written in a Service Worker and could instead live alongside the rest of my app. This made it silly easy to adopt. The fact that I can use it for testing as well makes MSW a huge productivity booster.

API mocking that is available anywhere: during development, on any level of testing, and even debugging. Living in a dedicated layer, Mock Service Worker is agnostic of the frameworks, libraries, or setups you may use.

Leave a Comment