API Testing · Middle · Question 59 of 75
What is the role of mocks like MSW for frontend tests of API errors?
- 1They let the UI be tested against 500s, timeouts and edge data
- 2They replace the need to test the real API anywhere
- 3They speed up the real backend during tests
Show the answer
Correct answer: They let the UI be tested against 500s, timeouts and edge data
Explanation
Mocking network responses in the browser or Node shows how the UI handles errors without changing the backend.