Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing and mocking guide? #109

Closed
avalanche-tm opened this issue May 11, 2022 · 6 comments
Closed

Testing and mocking guide? #109

avalanche-tm opened this issue May 11, 2022 · 6 comments

Comments

@avalanche-tm
Copy link

avalanche-tm commented May 11, 2022

Is there any guide on how to run code in tests or mock existing services? I tried to do something like this but I always get error 400. User does exist in database and running this same code in Flutter widget works perfectly.

 test('supabase test', () async {
    await Supabase.initialize(
      url: 'http://localhost:54321',
      anonKey: 'mykey',
      debug: true,
    );
    final res = await Supabase.instance.client.auth
        .signIn(email: 'user@example.com', password: 'test');
  });
@dshukertjr
Copy link
Member

Hi @avalanche-tm,

We currently do not have a guide on running tests, but might be a good one for me to work on. I think it might make sense to create an easily mocking package for Supabase.

In the mean while, the problem is that Flutter's test environment does not allow http request by default. There seems to be a way of overriding this behavior.

@avalanche-tm
Copy link
Author

@dshukertjr Thank you very much for quick response and also for all the effort you've put into this project. It's great!

@NonymousMorlock
Copy link

but might be a good one for me to work on

@dshukertjr Did you happen to ?

@dshukertjr
Copy link
Member

@NonymousMorlock
No, haven't yet.

@NonymousMorlock
Copy link

@dshukertjr Alright Thanks

@msubodh
Copy link

msubodh commented Jul 31, 2024

Is there an ETA on this? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants