toHaveReturnedWith
toHaveReturnedWith is a matcher in testing frameworks, particularly popular in JavaScript testing with libraries like Jest. It is used to assert that a mock function has been called and that its most recent call returned a specific value. This matcher is designed to verify the behavior of functions that are mocked or spied upon during the testing process.
The primary purpose of toHaveReturnedWith is to check if a mock function executed as expected and produced
To use totoHaveReturnedWith, you typically first mock the function you intend to test. Then, you invoke the