Testing · Middle · Question 10 of 75

Why can vi.mock("./api") be written below the imports and still work?

Explanation

jest.mock is hoisted by babel-jest the same way.

Further reading

Problem with a question

Testing · Middle · question 10

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