runTests method

  1. @override
Future<void> runTests()
override

Run the tests under the current mode

Implementation

@override
Future<void> runTests() async {
  final path = generatePath();

  for (final testName in testMap.keys) {
    final completer = Completer<SerializableTester>();
    testWidgets(
      testName,
      (widgetTester) => runTest(path, testName, widgetTester, completer),
    );

    unawaited(completer.future.then((value) => value.finish(path, testName)));
  }

  if (mode == ListTesterMode.generateOutput || mode == ListTesterMode.auto) {
    // This is super janky, but we need it so that the SerializableTester will
    // output to local.
    testWidgets('Delay to let file output happen...', (widgetTester) async {
      final currentTime = DateTime.now();
      while (DateTime.now().millisecondsSinceEpoch -
              currentTime.millisecondsSinceEpoch <
          1500) {
        await widgetTester.pumpAndSettle(const Duration(seconds: 1));
      }
    });
  }
}