Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.x: Fix deprecation warning on TestStore #2378

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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