From 6c736b6d7eaf13695a3aaec17ba848a34319833d Mon Sep 17 00:00:00 2001 From: Stephan Mantel Date: Tue, 28 May 2024 14:46:20 +0200 Subject: [PATCH] Run async test code directly Without the use of tester.runAsync --- example/test/main_test.dart | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/example/test/main_test.dart b/example/test/main_test.dart index 836ea537..1e4b9c6e 100644 --- a/example/test/main_test.dart +++ b/example/test/main_test.dart @@ -18,17 +18,15 @@ void main() { }); testWidgets('Tapping save stores task in database', (tester) async { - await tester.runAsync(() async { - await tester.pumpWidget(FloorApp(taskDao)); - final textFieldFinder = find.byType(TextField); - final raisedButtonFinder = find.byType(OutlinedButton); + await tester.pumpWidget(FloorApp(taskDao)); + final textFieldFinder = find.byType(TextField); + final raisedButtonFinder = find.byType(OutlinedButton); - await tester.enterText(textFieldFinder, 'Hello world!'); - await tester.tap(raisedButtonFinder); + await tester.enterText(textFieldFinder, 'Hello world!'); + await tester.tap(raisedButtonFinder); - final tasks = await taskDao.findAllTasks(); - expect(tasks, isNotEmpty); - }); + final tasks = await taskDao.findAllTasks(); + expect(tasks, isNotEmpty); }); testWidgets('Tapping save clears text input field', (tester) async {