How to mock functions in the same module using Jest?
An alternative solution can be importing the module into its own code file and using the imported instance of all of the exported entities. Like this: import * as thisModule from ‘./module’; export function bar () { return ‘bar’; } export function foo () { return `I am foo. bar is ${thisModule.bar()}`; } Now mocking … Read more