SupabaseMockServer class
An all-in-one mock for Supabase repsonses in unit tests.
Constructors
- SupabaseMockServer.new({String apiKey = 'supabaseKey', required SupabaseModelDictionary modelDictionary})
- An all-in-one mock for Supabase repsonses in unit tests.
Properties
- apiKey → String
-
A mock Supabase API key. Can be a blank string.
final
- client ↔ SupabaseClient
-
A real SupabaseClient that does not connect to Supabase
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListener ↔ bool
-
If a stream listener has been registered
getter/setter pair
- listener ↔ StreamSubscription?
-
The active stream listener
getter/setter pair
-
listeners
→ Set<
String> -
Active stream listeners
final
- modelDictionary → SupabaseModelDictionary
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- server ↔ HttpServer
-
The created and reassigned HttpServer
getter/setter pair
- serverUrl → String
-
The simulated server URL
no setter
- webSocket ↔ WebSocket?
-
The stubbed websocket that can be listed to for streams
getter/setter pair
Methods
-
handle(
Map< SupabaseRequest< responses) → Future<SupabaseModel> , SupabaseResponse>void> - Invoke within a test block before any calls are made to a Supabase server
-
handleRealtime(
HttpRequest request, Map< SupabaseRequest< responses) → Future<SupabaseModel> , SupabaseResponse>void> - Handle realtime/stream requests
-
handleRest(
HttpRequest request, Map< SupabaseRequest< responses) → HttpResponseSupabaseModel> , SupabaseResponse> - Handle regular REST requests
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize<
TModel extends SupabaseModel> (TModel instance, {String? realtimeFilter, String? schema = 'public', PostgresChangeEvent? realtimeEvent, ModelRepository< SupabaseModel> ? repository}) → Future<Map< String, dynamic> > - Convert a model to a Supabase response.
-
setUp(
) → Future< void> -
Invoke within a group as
setUp(mock.setUp)
. -
tearDown(
) → Future< void> -
Invoke within a group as
tearDown(mock.tearDown)
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited