Testing · Middle · Question 15 of 75
Where do manual mocks for a node module live in Jest?
- ✓Correct answer: In a
__mocks__folder next tonode_modules(project root), e.g.__mocks__/axios.js - 2In
jest.config.jsundermocks - 3In the same file as the test
Explanation
Node module mocks in root __mocks__ are applied automatically; mocks for your own modules need an explicit jest.mock(path).