Mocking avoids network latency and unreliability, making tests faster and more stable.
Real network calls can introduce delays and potential failures due to network issues or API changes, leading to flaky tests. By using mocks, you can simulate the network responses and focus on testing your application's logic. In an online store, mocking a shipping API ensures your tests run quickly and consistently without depending on the external service.