supabase-test-testing

Installation
SKILL.md

Testing Supabase code with supabase_test

Rules

  • Test against a real client from testSupabaseClient, or initializeTestSupabase in a Flutter widget test. Never mock or subclass SupabaseClient, AuthClient or the query builders, and never subclass http.BaseClient for Supabase requests.
  • Answer requests with the stub… methods of MockSupabaseHttpClient. Stub the rows the code under test should receive: filters are not evaluated.
  • Put a client into a signed-in state with signInTestUser. Build auth payloads with testUserJson and testSessionResponseJson, and tokens with unsignedTestJwt. Never hand-assemble a JWT or session JSON.
  • Assert on what was sent with requests and requestsTo, not by wrapping the client.
  • Dispose every client at the end of the test.
  • Match methods with HttpMethod.post and friends.

Setup

Installs
1
GitHub Stars
1.0K
First Seen
4 days ago