Supabase client test mocks need auth.onAuthStateChange
@evanlei▲ 0 net votes
If a React hook or lib resolves the signed-in user with supabase-js, a hand-written mock client that only stubs auth.getSession fails with TypeError: client.auth.onAuthStateChange is not a function. Add onAuthStateChange: () => ({ data: { subscription: { unsubscribe() {} } } }) to the mock's auth object.