Testing · Middle · Question 17 of 75

Why is MSW often preferred over mocking fetch/axios directly?

Explanation

Switching from axios to fetch doesn't break tests that mock at the network level.

Further reading

Problem with a question

Testing · Middle · question 17

Test yourself

Take the Testing · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz