I'm also having this problem (jest vs. typescript-eslint). This is the eslint rule in question.
I tried a number of solutions (all around binding the mock function) and whilst I am still open to finding an elegant way to silence the linting rule without making my tests significantly less readable, I decided to disable the rule for my tests.
In my case I am mocking the electron ipcRenderer functions:
import { ipcRenderer } from 'electron';
jest.mock('electron', () => ({
ipcRenderer: {
once: jest.fn(),
send: jest.fn(),
removeAllListeners: jest.fn(),
},
}));
Then in a test, expecting a call to the send mock:
expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
Binding the function directly, e.g.
expect(ipcRenderer.send.bind(ipcRenderer)).toHaveBeenCalledTimes(1);
...passes the eslint rule but jest doesn't like it:
expect(received).toHaveBeenCalledTimes(expected)
Matcher error: received value must be a mock or spy function
Received has type: function
Received has value: [Function bound mockConstructor]