You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having difficulty getting the widget tests to pass with auto_route and getIt.
i've found possible solutions on these issues #1138, #745 .
I also tried the solution mentioned in this comment: #1138 (comment), but unfortunately none of these worked for me.
The following _TypeError was thrown running a test:
type 'Null'is not a subtype of type 'Future<Object?>'When the exception was thrown, this was the stack:
#0MockAppRouter.push (file:///C:/Users/Usuario/Documents/project/test/dashboard/presentation/widgets/skip_dashboard_test.mocks.dart:34:7)
#1 main.<anonymous closure>.<anonymous closure> (file:///C:/Users/Usuario/Documents/project/test/dashboard/presentation/widgets/skip_dashboard_test.dart:27:53)
#2 testWidgets.<anonymous closure>.<anonymous closure> (package:flutter_test/src/widget_tester.dart:170:29)
<asynchronous suspension><asynchronous suspension>
(elided one frame from package:stack_trace)
Mocks were created with mockito library.
I don't know if the solutions mentioned in the referenced issues above are outdated or incompatible with the current version of the auto_route library or i'm wrong on some configuration
The text was updated successfully, but these errors were encountered:
@seriann@n0ks I'm doing the following in AutoRoute internal tests
lateSimpleRouter router;
setUp(() {
// Setting ignore pop completes to true will not return the actual// route pop completer but a SynchronousFuture(null);
router =SimpleRouter()..ignorePopCompleters =true;
});
test( 'Pushing single route should add it to the top of stack', () async {
await router.push(constFirstRoute());
expect(router.current.name, FirstRoute.name);
/// or check the whole current hiererchyexpect(router.currentHierarchy(), const [
HierarchySegment(FirstRoute.name),
]);
});
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions
Hello everyone,
I'm having difficulty getting the widget tests to pass with auto_route and getIt.
i've found possible solutions on these issues #1138, #745 .
I also tried the solution mentioned in this comment: #1138 (comment), but unfortunately none of these worked for me.
Router:
GetIt Instance
Main.dart:
Test with auto_route and get_it:
this test returns error:
Mocks were created with mockito library.
I don't know if the solutions mentioned in the referenced issues above are outdated or incompatible with the current version of the auto_route library or i'm wrong on some configuration
The text was updated successfully, but these errors were encountered: