79576839

Date: 2025-04-16 09:39:07
Score: 0.5
Natty:
Report link

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;
});
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: undsoft