I was working on a Promise<notVoid> method at that time. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. Returns a Jest mock function." What this means is that the function acts as it normally wouldhowever, all calls are being tracked. If I split each test into an individual file, both work. In this article, well look at how to make a mock throw an error in Jest. In Jest you have to pass a function into expect(function).toThrow(
jest mock throw error