supabase-test-testing
Installation
SKILL.md
Testing Supabase code with supabase_test
Rules
- Test against a real client from
testSupabaseClient, orinitializeTestSupabasein a Flutter widget test. Never mock or subclassSupabaseClient,AuthClientor the query builders, and never subclasshttp.BaseClientfor Supabase requests. - Answer requests with the
stub…methods ofMockSupabaseHttpClient. 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 withtestUserJsonandtestSessionResponseJson, and tokens withunsignedTestJwt. Never hand-assemble a JWT or session JSON. - Assert on what was sent with
requestsandrequestsTo, not by wrapping the client. - Dispose every client at the end of the test.
- Match methods with
HttpMethod.postand friends.