File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
Tests/ComposableArchitectureTests Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -1227,11 +1227,13 @@ final class StoreTests: BaseTCATestCase {
12271227 } withDependencies: {
12281228 $0. continuousClock = clock
12291229 }
1230- store1. send ( . tap)
1231- store2. send ( . tap)
1230+ let task1 = store1. send ( . tap)
1231+ let task2 = store2. send ( . tap)
12321232 try await Task . sleep ( for: . seconds( 1 ) )
12331233 store2. send ( . cancelButtonTapped)
1234- await clock. run ( timeout: . seconds( 1 ) )
1234+ await clock. advance ( )
1235+ await task1. finish ( )
1236+ await task2. finish ( )
12351237 XCTAssertEqual ( store1. count, 42 )
12361238 XCTAssertEqual ( store2. count, 0 )
12371239 }
@@ -1252,7 +1254,7 @@ final class StoreTests: BaseTCATestCase {
12521254 await store1. send ( . tap)
12531255 await store2. send ( . tap)
12541256 await store2. send ( . cancelButtonTapped)
1255- await clock. run ( )
1257+ await clock. advance ( )
12561258 await store1. receive ( \. response) {
12571259 $0. count = 42
12581260 }
@@ -1280,7 +1282,7 @@ final class StoreTests: BaseTCATestCase {
12801282 return . none
12811283 case . tap:
12821284 return . run { send in
1283- try await clock. sleep ( for: . seconds( 1 ) )
1285+ try await clock. sleep ( for: . seconds( 0 ) )
12841286 await send ( . response( 42 ) )
12851287 }
12861288 . cancellable ( id: CancelID . effect)
You can’t perform that action at this time.
0 commit comments