 class ImagePipelineAsyncAwaitTests: XCTestCase {
     var dataLoader: MockDataLoader!
     var pipeline: ImagePipeline!
+    private var recordedProgress: [Progress] = []
 
     override func setUp() {
         super.setUp()

    }

    func testMonitoringProgressLoadData() async throws {
        struct Progress: Equatable {
            let completed, total: Int64
        }

        // GIVEN
        dataLoader.results[Test.url] = .success(
            (Data(count: 20), URLResponse(url: Test.url, mimeType: "jpeg", expectedContentLength: 20, textEncodingName: nil))
        )

        // WHEN
        var recordedProgress: [Progress] = []

        do {
            try await pipeline.data(for: Test.request, progress: {
                recordedProgress.append(Progress(completed: $0, total: $1))
            })
        } catch {
            // Do nothing

    // MARK: - Progress Monitoring

    func testMonitoringProgress() async throws {
        // GIVEN
        dataLoader.results[Test.url] = .success(
            (Data(count: 20), URLResponse(url: Test.url, mimeType: "jpeg", expectedContentLength: 20, textEncodingName: nil))
        )

        // WHEN
        do {
            try await pipeline.image(for: Test.request, progress: {
                self.recordedProgress.append(Progress(completed: $1, total: $2))
            })
        } catch {
            // Do nothing
