Jest · Matcher
toHaveReturned
toHaveReturned() checks that a Jest mock function successfully returned at least once. Calls that throw an error do not count.
Last updated
Syntax
expect(mockFunction).toHaveReturned()In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
toHaveReturnedTimestoHaveReturnedWithtoHaveLastReturnedWithtoHaveNthReturnedWith