Skip to content

Commit

Permalink
Fix: deprecation warning on TestStore (#2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaRomani authored Aug 16, 2023
1 parent 67eb94f commit 3a2b7d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Sources/ComposableArchitecture/TestStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
/// accessed during the test. These dependencies will be used when producing the initial
/// state.
public init<R: Reducer>(
initialState: @autoclosure () -> State,
initialState: @autoclosure () -> R.State,
@ReducerBuilder<State, Action> reducer: () -> R,
withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in
},
Expand Down Expand Up @@ -581,7 +581,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
"""
)
public convenience init<R: Reducer>(
initialState: @autoclosure () -> State,
initialState: @autoclosure () -> R.State,
@ReducerBuilder<State, Action> reducer: () -> R,
observe toScopedState: @escaping (State) -> ScopedState,
withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in },
Expand Down Expand Up @@ -615,7 +615,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
"""
)
public init<R: Reducer>(
initialState: @autoclosure () -> State,
initialState: @autoclosure () -> R.State,
@ReducerBuilder<State, Action> reducer: () -> R,
observe toScopedState: @escaping (State) -> ScopedState,
send fromScopedAction: @escaping (ScopedAction) -> Action,
Expand Down Expand Up @@ -656,7 +656,7 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
/// state.
@available(*, deprecated, message: "State must be equatable to perform assertions.")
public init<R: Reducer>(
initialState: @autoclosure () -> State,
initialState: @autoclosure () -> R.State,
@ReducerBuilder<State, Action> reducer: () -> R,
withDependencies prepareDependencies: (inout DependencyValues) -> Void = { _ in
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ final class PresentationReducerTests: BaseTCATestCase {
}

let mainQueue = DispatchQueue.test
let store = TestStore(initialState: Parent.State()) {
let store = TestStore(initialState: .init()) {
Parent()
} withDependencies: {
$0.mainQueue = mainQueue.eraseToAnyScheduler()
Expand Down

0 comments on commit 3a2b7d7

Please sign in to comment.