File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Sources/ComposableArchitecture
Tests/ComposableArchitectureTests Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -1895,7 +1895,7 @@ extension TestStore {
18951895 )
18961896
18971897 for effect in self . reducer. inFlightEffects {
1898- _ = Effect < Never , Never > . cancel ( id: effect. id) . producer. startWithValues { _ in }
1898+ _ = Effect < Never , Never > . cancel ( id: effect. id) . producer. startWithCompleted { }
18991899 }
19001900 self . reducer. inFlightEffects = [ ]
19011901 }
@@ -2215,7 +2215,8 @@ private func _XCTExpectFailure(
22152215 strict: Bool = true ,
22162216 failingBlock: ( ) -> Void
22172217) {
2218- #if DEBUG
2218+ // Obj-C runtime functions not supported on Linux, e.g. `NSSelectorFromString`
2219+ #if DEBUG && !os(Linux)
22192220 guard
22202221 let XCTExpectedFailureOptions = NSClassFromString ( " XCTExpectedFailureOptions " )
22212222 as Any as? NSObjectProtocol ,
Original file line number Diff line number Diff line change 1- #if DEBUG
1+
2+ // `@MainActor` introduces issues gathering tests on Linux
3+ #if DEBUG && !os(Linux)
24 import ComposableArchitecture
5+ import ReactiveSwift
36 import XCTest
47
58 @MainActor
493496 }
494497
495498 func testPartialExhaustivityPrefix( ) async {
496- let testScheduler = DispatchQueue . test
499+ let testScheduler = TestScheduler ( )
497500 enum Action {
498501 case buttonTapped
499502 case response( Int )
668671 // This example comes from Krzysztof Zabłocki's blog post:
669672 // https://www.merowing.info/exhaustive-testing-in-tca/
670673 func testKrzysztofExample3( ) {
671- let mainQueue = DispatchQueue . test
674+ let mainQueue = TestScheduler ( )
672675
673676 let store = TestStore (
674677 initialState: KrzysztofExample . State ( ) ,
675678 reducer: KrzysztofExample ( )
676679 )
677680 store. exhaustivity = . off
678- store. dependencies. mainQueue = mainQueue. eraseToAnyScheduler ( )
681+ store. dependencies. mainQueue = mainQueue
679682
680683 store. send ( . advanceAgeAndMoodAfterDelay)
681684 mainQueue. advance ( by: 1 )
770773 . init( value: . changeAge( state. age + 1 ) ) ,
771774 . init( value: . changeMood( state. mood + 1 ) )
772775 )
773- . delay ( for: 1 , scheduler: self . mainQueue)
774- . eraseToEffect ( )
776+ . deferred ( for: 1 , scheduler: self . mainQueue)
775777
776778 case let . changeAge( age) :
777779 state. age = age
You can’t perform that action at this time.
0 commit comments