When testing a module that has a dependency in a different file. When assigning that module to be jest.Mock typescript gives an error that the method mock
jest.Mock
mock
as jest.Mock
Simply casting the function to jest.Mock should do the trick:
(dep.default as jest.Mock).mockReturnValueOnce('return')