install static method
void
install({
- Object? responseFactory(
- Request request
- MockResponder? responder,
- Map<
String, Object> storageValues = const <String, Object>{}, - DateTime clock()?,
- BifrostNotificationRecorder? notifications,
- BifrostInternalDiagnosticRecorder? diagnostics,
- bool dispatchNotifications = false,
- FutureOr<
void> initializeApplication()?,
Declares the per-test lifecycle once in flutter_test_config.dart.
initializeApplication runs after Bifrost has installed a fresh mock
transport and preference store, so async services resolve the test store
rather than retaining a handle created before the reset.
Implementation
static void install({
Object? Function(http.Request request)? responseFactory,
MockResponder? responder,
Map<String, Object> storageValues = const <String, Object>{},
DateTime Function()? clock,
BifrostNotificationRecorder? notifications,
BifrostInternalDiagnosticRecorder? diagnostics,
bool dispatchNotifications = false,
FutureOr<void> Function()? initializeApplication,
}) {
_validateTransport(responseFactory, responder);
flutter_test.setUp(() async {
reset(
responseFactory: responseFactory,
responder: responder,
storageValues: storageValues,
clock: clock,
notifications: notifications,
diagnostics: diagnostics,
dispatchNotifications: dispatchNotifications,
);
await initializeApplication?.call();
});
}