GoTrue 인증 API와 상호 작용하기 위한 Dart 클라이언트 라이브러리로, Flutter 애플리케이션에서 사용자 관리를 안전하게 가능하게 합니다. 회원가입, 로그인, 비밀번호 복구 및 세션 처리를 지원하며 내장된 토큰 관리 기능을 제공합니다. Supabase와의 원활한 통합을 위해 설계되어 여러 플랫폼에서 일관된 인증 경험을 제공합니다. 상태 지속성과 리스너를 통한 실시간 업데이트를 처리합니다. 강력하고 확장 가능한 인증 기능이 필요한 앱 개발에 이상적입니다.
The helpers the test suites of these packages run on are published in
package:supabase_test,
so your tests can build on the same primitives: mock HTTP clients, JWT builders,
auth session fixtures and realtime frames. Add the package as a dev dependency:
dev_dependencies:supabase_test:^0.1.0
Then stub the endpoints the code under test talks to and run it against a
real SupabaseClient, with no running stack required:
final httpClient = MockSupabaseHttpClient()
..stubTable('todos', rows: [
{'id': 1, 'task': 'Ship it', 'status': false},
]);
final supabase = testSupabaseClient(httpClient: httpClient);
addTearDown(supabase.dispose);
final todos = await supabase.from('todos').select();
expect(todos, hasLength(1));
See the supabase_test README for the
full guide: stubbing database, rpc, edge function and auth endpoints,
asserting on recorded requests, running tests as a signed-in user, and wiring
Supabase.initialize in Flutter widget tests.
Testing this repo
The tests for the packages postgrest, supabase_auth, supabase_realtime and supabase_storage run against a
local Supabase stack. To run these tests locally you need docker and the
Supabase CLI installed.
The single configuration for the stack lives in the supabase directory at the repository root.
Start it with:
supabase start
Run the Dart tests within the package directory in packages/<package> with the following command.
The -j 1 flag runs the tests not concurrently, which works better since the tests run against the
same services.
dart test -j 1
To stop the stack run the following command from the repository root: