Frontend & browser·Testing a user interface
you intercepted the request at the network layer instead of stubbing the function that makes it.
Network mocking
Also calledrequest interception, MSW
Replacing responses at the HTTP boundary so the code under test makes its real requests and receives controlled answers. It keeps the fetching code in the test's path, unlike stubbing the client, which is where header, serialisation and error-handling bugs hide. The risk is the usual one for any fake: handlers that drift from what the real API returns give you a green suite and a broken feature.