run<T> method

T run<T>(
  1. RecordingTesterCallback<T> body
)

Implementation

T run<T>(RecordingTesterCallback<T> body) {
  final interceptor = HttpRecordInterceptor();

  var hasCreatedClient = false;

  return runWithClient(
    () {
      try {
        return body(interceptor);
      } finally {
        if (!hasCreatedClient) {
          _debugLog('WARNING: No recording http clients were created.');
        }
      }
    },
    () {
      hasCreatedClient = true;
      return _createClient(interceptor);
    },
  );
}