Open utterances-bot opened 1 month ago
For some reason I was not able to assign the mock method to utils.fetch
. I am getting TypeError: Cannot set property loadStaticCalendar of [object Object] which has only a getter
. Otherwise without import for a method, this is working.
How to Correctly Mock Promises in Jest - Webtips
In order to mock asynchronous code in Jest, more specifically Promises, you want to use the mockResolvedValue function with a return value.
https://webtips.dev/webtips/jest/mock-promises-in-jest