You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
APIEndpoints.ts (implements functions that would call out and return useAxios to Pinia)
useXStore, that will trigger abovementioned function, then have a watch() on isLoading to tick over that will set the state
Component, that implements useXStore and triggers the state to be loaded
I figured by making APIEndpoints, I can spyOn the function and return the mocked data in my test, but this simply doesn't work.
Does anyone have a real-world testable example of using Vue + Pinia + useAxios + Vitest??
I'd love to have my dev's be able to check for isLoading/isFinished/isError etc without having to implement those features manually
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm struggling to test when using useAxios
I have:
APIEndpoints.ts (implements functions that would call out and return useAxios to Pinia)
useXStore, that will trigger abovementioned function, then have a watch() on isLoading to tick over that will set the state
Component, that implements useXStore and triggers the state to be loaded
I figured by making APIEndpoints, I can spyOn the function and return the mocked data in my test, but this simply doesn't work.
Does anyone have a real-world testable example of using Vue + Pinia + useAxios + Vitest??
I'd love to have my dev's be able to check for isLoading/isFinished/isError etc without having to implement those features manually
Beta Was this translation helpful? Give feedback.
All reactions