The setup:
I have module that I want to mock in my tests, so I write this:
jest.mock('path/to/module, () => mocked_value);
in the top of my test file and it works fine.
The problem:
I want to use the same mock (mocked_value is a somewhat large object, and there are multiple modules being mocked) in multiple tests, but I cannot put the jest.mock calls into a separate function in a separate file, because then it doesn't work.
I have tried doMock instead, but is also doesn't work. The test is in TypeScript if it is relevant.
Edit:
doMock should work for this purpose, but it doesn't work for me at all. Even when I put doMock directly into the test file (where mock was working just fine), it doesn't work. Putting it directly into the test function doesn't work either.
Environment: