Closed
Description
I'm having problems testing the widget to registerFactory using mockito and getIt.
This code worked before the flutter/dart migration.
My Code Test:
` var mockAnalytics = MockFBAnalytics();
GetIt.instance.registerFactory<AnalyticsService>(() => mockAnalytics);
when(mockAnalytics.getAnalytics()).thenReturn(FirebaseAnalytics());`
Error when running:
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following _TypeError was thrown running a test:
type 'Null' is not a subtype of type 'FirebaseAnalytics'
Ref: https://flutterprojects.blog/2021/05/17/widget-testing-with-mockito/
Metadata
Metadata
Assignees
Labels
No labels