-
Hi, I have been using below mock on my test but recently I have updated this externalService to throw errors on its methods as well. Therefore I would like to case where the service throws an error. I tried using vi.doMock inside the test case to isolate it and write it's own externalService mock but it did not work. It still reads this mock which on top of the file. How can I achieve this? Maybe I need to define functions with vi.fn, mockResolvedValue etc to make it dynamic, but could not figure it out from the docs. Please forgive my ignorance as I am very new to testing.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sorted out the issue, for anyone needs it in the future please see below.
|
Beta Was this translation helpful? Give feedback.
Sorted out the issue, for anyone needs it in the future please see below.