If I put file.ts
in /project-root
, the file file.ts
which is in /__mocks__
is being used by Jest after doing jest.mock(...)
. However, I want to be able to directly import original files inside /src
(or deeper) and get Jest to use the mocks inside /__mocks__
. Imitating the folder structure (i.e. /__mocks__/src/file.ts
) does not work.
Folder structure:
/project-root
/__mocks__
/__tests__
/src
/routes
/controllers
/etc.
package.json
package-lock.json