Testing · Middle · Question 42 of 75

Why do Jest and Vitest isolate test files by default?

Explanation

Inside one file, state is shared between tests - reset it in hooks.

Further reading

Problem with a question

Testing · Middle · question 42

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