Closed rrousselGit closed 4 months ago
Sorry for delay on it. Yes, tests with exceptions do not dispose state. Such tests should be opted out from leak tracking:
testWidgets('async onInit throws FlutterError',
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(), // leaking by design because of exception
(WidgetTester tester) async {
...
Documented this: https://github.com/dart-lang/leak_tracker/pull/238 Thanks for flagging!
Hello!
Consider the following test:
This will fail with:
I assume the issue is that if an exception happens in
initState
,State.dispose
never gets called.