functions_client 패키지는 Flutter 애플리케이션에서 Supabase Functions와 상호작용할 수 있도록 해주는 Dart 라이브러리입니다. 개발자는 앱에서 직접 서버리스 함수를 호출할 수 있습니다. Supabase 호스팅 함수에 HTTP 요청을 보내는 간단하고 타입 안전한 API를 제공하며, 인증 및 오류 처리를 지원합니다. 서버 관리를 하지 않고도 데이터 처리, 파일 조작, 제3자 통합과 같은 백엔드 로직을 실행하는 데 이상적입니다. 클라이언트는 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: