patrolTearDown function

void patrolTearDown(
  1. dynamic body()
)

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

Implementation

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

    final currentTest = global_state.currentTestFullName;

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

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