Cannot find module '../request' error using mock in Jest
The path in jest.mock
needs to be the relative path from your test to the module you want to mock (request.js
) and the __mocks__
folder needs to be in the folder where the original request.js
file is in. From your screenshot its hard to see if its like this. Also your test dont show the jest.mock('../request');
line.