reset static method
void
reset({
- Object? responseFactory(
- Request request
- MockResponder? responder,
- Map<
String, Object> storageValues = const <String, Object>{}, - DateTime clock()?,
- BifrostNotificationRecorder? notifications,
- BifrostInternalDiagnosticRecorder? diagnostics,
- bool dispatchNotifications = false,
Restores Bifrost's runtime seams atomically for one test.
Implementation
static void reset({
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,
}) {
_validateTransport(responseFactory, responder);
notifications?.reset();
diagnostics?.reset();
bifrostNotificationSettings = BifrostNotificationSettings(
observer: notifications?.call,
dispatch: dispatchNotifications,
);
bifrostInternalDiagnosticSettings = BifrostInternalDiagnosticSettings(
observer: diagnostics?.call,
);
bifrostClock = clock ?? DateTime.now;
bifrostUseFakes = false;
// `useMockClient` installs every explicit answer behind the per-request
// seam. Clear first so an omitted fixture restores generic fake JSON.
bifrostMockResponder = null;
useMockClient(responseFactory: responseFactory, responder: responder);
useMockStorage(values: storageValues);
bifrostJsonDecode = (body) async => jsonDecode(body);
bifrostPerformanceTracker = const NoOpPerformanceTracker();
}