patrolSetUp function

void patrolSetUp(
  1. dynamic body()
)

A modification of setUp that works with Patrol's native automation.

Implementation

void patrolSetUp(dynamic Function() body) {
  setUp(() async {
    if (constants.hotRestartEnabled) {
      await body();
      return;
    }

    final currentTest = global_state.currentTestFullName;

    final requestedToExecute = await PatrolBinding.instance.patrolAppService
        .waitForExecutionRequest(currentTest);

    if (requestedToExecute) {
      await body();
    }
  });
}