T
TanStack2y ago
conscious-sapphire

How do I mock API responses from useQuery with Vue and Vitest?

Does anyone have an example?
1 Reply
conscious-sapphire
conscious-sapphireOP2y ago
Based on my reading is seems like using Mock Service Worker is the recommended way to mock the API requests but I’m having a hard time finding examples with Vue Query. I think I got it working with MSW. I’m using Vue Test Utils with Vitest and I had to add await flushPromises() to the test.

Did you find this page helpful?