@@ -431,8 +431,7 @@ import IssueReporting
431431#else
432432 @preconcurrency @MainActor
433433#endif
434- public final class TestStore < State, Action> {
435-
434+ public final class TestStore < State: Equatable , Action> {
436435 /// The current dependencies of the test store.
437436 ///
438437 /// The dependencies define the execution context that your feature runs in. They can be modified
@@ -529,17 +528,15 @@ public final class TestStore<State, Action> {
529528 /// - filePath: The filePath.
530529 /// - line: The line.
531530 /// - column: The column.
532- public init < R : Reducer > (
531+ public init (
533532 initialState: @autoclosure ( ) -> State ,
534- reducer: ( ) -> R ,
535- withDependencies prepareDependencies: ( inout DependencyValues ) -> Void = { _ in
536- } ,
533+ reducer: ( ) -> some Reducer < State , Action > ,
534+ withDependencies prepareDependencies: ( inout DependencyValues ) -> Void = { _ in } ,
537535 fileID: StaticString = #fileID,
538536 file filePath: StaticString = #filePath,
539537 line: UInt = #line,
540538 column: UInt = #column
541- )
542- where State: Equatable , R. State == State , R. Action == Action {
539+ ) {
543540 let sharedChangeTracker = SharedChangeTracker ( )
544541 let reducer = Dependencies . withDependencies {
545542 prepareDependencies ( & $0)
@@ -858,9 +855,9 @@ public final class TestStore<State, Action> {
858855/// ```swift
859856/// let testStore: TestStoreOf<Feature>
860857/// ```
861- public typealias TestStoreOf < R: Reducer > = TestStore < R . State , R . Action >
858+ public typealias TestStoreOf < R: Reducer > = TestStore < R . State , R . Action > where R . State : Equatable
862859
863- extension TestStore where State : Equatable {
860+ extension TestStore {
864861 /// Sends an action to the store and asserts when state changes.
865862 ///
866863 /// To assert on how state changes you can provide a trailing closure, and that closure is handed
@@ -1276,7 +1273,7 @@ extension TestStore where State: Equatable {
12761273 }
12771274}
12781275
1279- extension TestStore where State : Equatable , Action: Equatable {
1276+ extension TestStore where Action: Equatable {
12801277 private func _receive(
12811278 _ expectedAction: Action ,
12821279 assert updateStateToExpectedResult: ( ( inout State ) throws -> Void ) ? = nil ,
@@ -1450,7 +1447,7 @@ extension TestStore where State: Equatable, Action: Equatable {
14501447 }
14511448}
14521449
1453- extension TestStore where State : Equatable {
1450+ extension TestStore {
14541451 private func _receive(
14551452 _ isMatching: ( Action ) -> Bool ,
14561453 assert updateStateToExpectedResult: ( ( inout State ) throws -> Void ) ? = nil ,
@@ -2250,7 +2247,7 @@ extension TestStore where State: Equatable {
22502247 }
22512248}
22522249
2253- extension TestStore where State : Equatable {
2250+ extension TestStore {
22542251 /// Sends an action to the store and asserts when state changes.
22552252 ///
22562253 /// This method is similar to ``send(_:assert:fileID:file:line:column:)-8f2pl``, except it allows
@@ -2814,7 +2811,7 @@ public struct TestStoreTask: Hashable, Sendable {
28142811 }
28152812}
28162813
2817- class TestReducer < State, Action> : Reducer {
2814+ class TestReducer < State: Equatable , Action> : Reducer {
28182815 let base : Reduce < State , Action >
28192816 var dependencies : DependencyValues
28202817 let effectDidSubscribe = AsyncStream . makeStream ( of: Void . self)
0 commit comments