How to mock useSupabaseClient
composable?
#363
Unanswered
jimmiejackson414
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm hoping someone has worked through a similar issue, but I'm having the hardest time figuring out how to mock the
useSupabaseClient
composable. Granted I'm not great at Vitest. Here is what I have currently which has gotten past the first couple sets of Supabase/vitest-related errors:In my Vue component, I have a fairly simple use of an .rpc function:
And here is the error I'm seeing when running the test from my terminal:
So how do I correctly mock the .rpc function on the useSupabaseClient composable? For that matter, is there a better way of handling this in general?
Edit
I should also mention that I've been receiving env variable errors when running the vitest tests, even though they are most definitely set in my .env file and works just fine in the application.
Beta Was this translation helpful? Give feedback.
All reactions