#Vue useQuery and Vitest

3 messages · Page 1 of 1 (latest)

tawny gulch
#

Does any one have a snipet an example or a hint how do you go about testing a component that has a useQuery in it?

Do we just mock the async function that the query is using?

short wind
#

I'd like to know as well.

obsidian jewel
#

I like to use Mock Service Worker https://mswjs.io/ and have used it extensively with React Query. I'm planning to use it with Vue and Vitest soon too.

Mock Service Worker

Seamless API mocking library for browser and Node.