I have a javascript project with jsconfig.json
configured properly. It works for almost everything except for when I mock a module with jest.mock()
on my unit tests:
// unit.test.js
jest.mock('./api')
it('does something', () => {
// Linting error:
// Property 'mockResolvedValue' does not exist on type () => Promise<any>
api.loadStudents.mockResolvedValue([]);
});
Is there any way to let TSServer know that Jest is mocking this module, so the exported object properties are instances of jest.Mock
?