Testing · Middle · Question 40 of 75

What is a setup file (setupFiles in Vitest, setupFilesAfterEnv in Jest) used for?

Explanation

Jest's setupFilesAfterEnv runs after the test framework is installed, so expect.extend and hooks like afterEach are available there.

Further reading

Problem with a question

Testing · Middle · question 40

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