callCount method

int callCount({
  1. String? method,
  2. Pattern? path,
})

Number of requests seen, optionally narrowed by method and path.

Implementation

int callCount({String? method, Pattern? path}) {
  return _requests.where((r) {
    if (method != null && r.method != method.toUpperCase()) {
      return false;
    }
    return path == null || _matchesPath(path, r.path);
  }).length;
}