postRun method

  1. @override
FutureOr<void> postRun(
  1. TaskResult result
)
override

Action to run after a task associated with this RunCondition has run, whether successfully or not.

This method will not be called if the Dartle cache has been disabled.

Implementation

@override
FutureOr<void> postRun(TaskResult result) async {
  if (verifyDeletions) {
    final failedToDelete = await _collectNotDeleted().toList();
    if (failedToDelete.isNotEmpty) {
      final taskName = result.invocation.name;
      throw DartleException(
          message:
              "task '$taskName' did not delete the following expected entities:\n"
              '${failedToDelete.map((f) => '  * $f').join('\n')}');
    }
  }
}