convenientTestMain function

Future<void> convenientTestMain(
  1. ConvenientTestSlot slot,
  2. FutureOr<void> testBody(), {
  3. ExecutionEnv executionEnv = ExecutionEnv.deviceTest,
})

Please make this the only method in your "main" method.

Implementation

Future<void> convenientTestMain(
  ConvenientTestSlot slot,
  FutureOr<void> Function() testBody, {
  ExecutionEnv executionEnv = ExecutionEnv.deviceTest,
}) async {
  myGetIt.registerSingleton<ConvenientTestSlot>(slot);
  ConvenientTestWrapperWidget.convenientTestActive = true;

  switch (executionEnv) {
    case ExecutionEnv.deviceTest:
      await convenientTestEntrypointWhenEnvDevice(testBody);
      break;
    case ExecutionEnv.widgetTest:
      await convenientTestEntrypointWhenEnvWidget(testBody);
      break;
  }
}