Skip to content

Commit 3a2b7d7

Browse files
authored
Fix: deprecation warning on TestStore (#2378)
1 parent 67eb94f commit 3a2b7d7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/ComposableArchitecture/TestStore.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
543543
/// accessed during the test. These dependencies will be used when producing the initial
544544
/// state.
545545
public init<R: Reducer>(
546-
initialState: @autoclosure () -> State,
546+
initialState: @autoclosure () -> R.State,
547547
@ReducerBuilder<State, Action> reducer: () -> R,
548548
withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in
549549
},
@@ -581,7 +581,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
581581
"""
582582
)
583583
public convenience init<R: Reducer>(
584-
initialState: @autoclosure () -> State,
584+
initialState: @autoclosure () -> R.State,
585585
@ReducerBuilder<State, Action> reducer: () -> R,
586586
observe toScopedState: @escaping (State) -> ScopedState,
587587
withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in },
@@ -615,7 +615,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
615615
"""
616616
)
617617
public init<R: Reducer>(
618-
initialState: @autoclosure () -> State,
618+
initialState: @autoclosure () -> R.State,
619619
@ReducerBuilder<State, Action> reducer: () -> R,
620620
observe toScopedState: @escaping (State) -> ScopedState,
621621
send fromScopedAction: @escaping (ScopedAction) -> Action,
@@ -656,7 +656,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
656656
/// state.
657657
@available(*, deprecated, message: "State must be equatable to perform assertions.")
658658
public init<R: Reducer>(
659-
initialState: @autoclosure () -> State,
659+
initialState: @autoclosure () -> R.State,
660660
@ReducerBuilder<State, Action> reducer: () -> R,
661661
withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in
662662
},

Tests/ComposableArchitectureTests/Reducers/PresentationReducerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,7 @@ final class PresentationReducerTests: BaseTCATestCase {
22422242
}
22432243

22442244
let mainQueue = DispatchQueue.test
2245-
let store = TestStore(initialState: Parent.State()) {
2245+
let store = TestStore(initialState: .init()) {
22462246
Parent()
22472247
} withDependencies: {
22482248
$0.mainQueue = mainQueue.eraseToAnyScheduler()

0 commit comments

Comments
 (0)