expectLatency static method

void expectLatency(
  1. HttpResponseSpec response,
  2. Duration maximum
)

Asserts that response latency does not exceed maximum.

Implementation

static void expectLatency(HttpResponseSpec response, Duration maximum) {
  if (response.latency > maximum) {
    throw StateError('Latency ${response.latency} exceeded $maximum');
  }
}