From e0942ea13522c9a4af510887d4fe44e774149f1f Mon Sep 17 00:00:00 2001 From: Kamil Strzelecki Date: Tue, 13 May 2025 22:23:07 +0200 Subject: [PATCH] - --- README.md | 46 ++++------------------------------------------ 1 file changed, 4 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 558ed9b..1994a3a 100644 --- a/README.md +++ b/README.md @@ -270,51 +270,13 @@ func testDownloadingImage() async throws { } @Test -func testDownloadingImageWhenLowQualityDownloadFailsAfterHighQualityDownloadSucceeds() async throws { - try await withProbing { - viewModel.downloadImage() - } dispatchedBy: { dispatcher in - #expect(viewModel.downloadState == nil) - - try await dispatcher.runUntilExitOfBody() - #expect(viewModel.downloadState?.isDownloading == true) - - try await dispatcher.runUntilEffectCompleted("high") - #expect(viewModel.downloadState?.quality == .high) - - downloader.shouldFailDownload = true - try await dispatcher.runUntilEffectCompleted("low") - try dispatcher.getCancelledValue(fromEffect: "low", as: Void.self) - #expect(viewModel.downloadState?.quality == .high) - } -} +func testDownloadingImageWhenHighQualityDownloadSucceedsFirst() async throws { ... } @Test -func testDownloadingImageRepeatedly() async throws { - try await withProbing { - viewModel.downloadImage() - viewModel.downloadImage() - } dispatchedBy: { dispatcher in - #expect(viewModel.downloadState == nil) - - try await dispatcher.runUntilExitOfBody() - #expect(viewModel.downloadState?.isDownloading == true) - - try await dispatcher.runUntilEffectCompleted("low0") - try dispatcher.getCancelledValue(fromEffect: "low0", as: Void.self) - #expect(viewModel.downloadState?.isDownloading == true) - - try await dispatcher.runUntilEffectCompleted("high0") - try dispatcher.getCancelledValue(fromEffect: "high0", as: Void.self) - #expect(viewModel.downloadState?.isDownloading == true) - - try await dispatcher.runUntilEffectCompleted("low1") - #expect(viewModel.downloadState?.quality == .low) +func testDownloadingImageWhenHighQualityDownloadFailsAfterLowQualityDownloadSucceeds() async throws { ... } - try await dispatcher.runUntilEffectCompleted("high1") - #expect(viewModel.downloadState?.quality == .high) - } -} +@Test +func testDownloadingImageRepeatedly() async throws { ... } // ... ```