Skip to content

Commit fef7e0c

Browse files
fix: change initializeTest to return a Future<void> to make it awaitable so a async main block can await until test loads (#34)
1 parent 93a57c5 commit fef7e0c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/lib/src/runner.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const MAX_TEST_DURATION_SECS = 24 * 60 * 60;
1212
// Can stay for now as it is not a breaking change
1313
const serverVersion = '0.0.28';
1414

15-
void initializeTest({Widget? app, Function? callback}) async {
15+
Future<void> initializeTest({Widget? app, Function? callback}) async {
1616
IntegrationTestWidgetsFlutterBinding binding =
17-
AppiumTestWidgetsFlutterBinding.ensureInitialized();
17+
AppiumTestWidgetsFlutterBinding.ensureInitialized();
1818

1919
if (app == null && callback == null) {
2020
throw Exception("App and callback cannot be null");
@@ -39,4 +39,5 @@ void initializeTest({Widget? app, Function? callback}) async {
3939
// To block the test from ending
4040
await Completer<void>().future;
4141
}, timeout: const Timeout(Duration(seconds: MAX_TEST_DURATION_SECS)));
42+
return;
4243
}

0 commit comments

Comments
 (0)