Testing · Junior · Question 36 of 78

Why mock network requests in unit and integration tests?

Explanation

A real backend can be slow, down or return different data. The real integration with the API is checked separately - by E2E or contract tests.

Further reading

Problem with a question

Testing · Junior · question 36

Test yourself

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

Take this quiz