-
-
Notifications
You must be signed in to change notification settings - Fork 69
Mock SupabaseClient. #12
Comments
Hey, @phamhieu have you considered this? |
Hi @happy-san, postgrest-dart uses
You can use |
Sorry for confusing you with the word |
Thank you for creating an example. Didn't know that a |
I was wondering about building something like a mock supabase client for my tests, but it was an up-hill battle for me. I moved my database calls to a layer that just talks to the database. For example, I have a dbInsert method that I pass a table name and some records. This method is very simple and just does an insert. My business logic contains a call to dbInsert, and I can easily mock this call in my test. |
_instance._initialized': You must initialize the supabase instance before calling Supabase. how to solve this this error showing while unit test and we using supabase only for aythentication and access token |
Feature request
Is your feature request related to a problem? Please describe.
Working on a little side-project to make a Todo app. It would be awesome to have a mock client to unit test my Repository class.
Describe the solution you'd like
A MockSupabaseClient that'll be useful for unit testing the code (similar to the
MockClient
fromhttp
package).Describe alternatives you've considered
Tried to create a mock, but got stuck since this gives me called
select('task, status')
on null. Also sinceSupabaseQueryBuilder
isn't exposed, I can't mock the response offrom('todos')
.I can help with this feature but I'll need some guidance along the way. Please let me know.
The text was updated successfully, but these errors were encountered: