You can also cast the whole function inside of mockImplementation
as typeof somefn
.
For example here it was picking incorrect overload and complaining about () => of(true);
This helps:
jest.spyOn(dialog, 'confirm').mockImplementation((() => {
return of(true)) as typeof dialog.confirm;
});