DEV Community

yanir manor
yanir manor

Posted on

Mocking is everywhere

Do you want to move faster in developing a fronted application? I think I have one part of the answer.
Mocking and simulating interaction with the backend can make you develop faster and better in development and integration testing mode. I came up with this idea when I developed integration testing via Cypress.
It helped me cover a broader range of behavior, and it was the perfect match for writing effective testing, but I felt that something was missing.
Sometimes I found myself wanting to mock the backend not only for testing.
After working with a couple of libraries, I found the perfect match: MSW (Mocking service worker).
The installation was very easy, and they have good documentation, allowing you to mock rest API or graphql.ֿ
The best feature is that any developer who works with the network tab in the devtools can intercept requests on the network level, making the mocking completely seamless.

Link: https://mswjs.io/docs/

Top comments (0)