In general, any time you see "foo is not a function" that suggests that you have an undefined reference.
If you've followed along with the post above, the possible points of failure are either forgetting to jest.mock the relevant module path (e.g. jest.mock('my/path')) or forgetting to cast a mock type using the original type as the base (e.g. const mockFoo = foo as jest.MockedFunction<typeof foo>).
I happened to be looking for Jest.mock in Medium and Dev.to, but couldn't find an Article as good as this one explained. Thank you Rupert for sharing such insightful article!
Lars Ejaas
Front end developer
Hi Rubert
Finally got to try this out in a project. I am however struggling with the following error:
TypeError: xxxxx.mockImplementation is not a functionHave you seen something like this before? Do you need to setup something specifically to handle mocks in jest.setup.ts or jest.config.js?