expectLastApiCall method

void expectLastApiCall(
  1. String apiName
)

Implementation

void expectLastApiCall(String apiName) {
  return RunnerBenchmark.sync('assertion', 'expectLastApiCall', () {
    final calls = _ensembleContext.apiOverlay.calls;
    if (calls.isEmpty || calls.last.name != apiName) {
      throw EnsembleTestFailure(
        'Expected last API call to be "$apiName", '
        'but got ${calls.isEmpty ? "none" : calls.last.name}.',
      );
    }
  });
}