[Vuejs]-Axios.get.mockResolvedValue() is marked as problem in testfile.test.ts (Vue/Vitest)

0👍

There is a helper vi.mocked() to resolve this issue with typescript.

https://vitest.dev/api/vi.html#vi-mocked

This should fix it:

vi.mocked(axios.get).mockResolvedValue()

-2👍

I don’t know how to solve this problem with *.test.ts file but I solved it when using *.test.js file.

Leave a comment