I\'m trying to mock a TypeScript class with Jest and I\'m obviously doing something because receive the following error:
error TS2743: No overload expects 1
Jest has the following signature for jest.fn:
/**
* Creates a mock function. Optionally takes a mock implementation.
*/
function fn(implementation?: (...args: Y) => T): Mock;
So you need to specify the array of types for the args, in your particular case you could just pass an empty array as there are no args in your implementation function.
const MockFoo = jest.fn(() => ({