@@ -663,22 +663,18 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
663
663
Environment == Void
664
664
{
665
665
var dependencies = DependencyValues . _current
666
- let initialState = withDependencies {
666
+ let reducer = withDependencies {
667
667
prepareDependencies ( & dependencies)
668
668
$0 = dependencies
669
669
} operation: {
670
- initialState ( )
670
+ TestReducer ( Reduce ( reducer ( ) ) , initialState: initialState ( ) )
671
671
}
672
-
673
- let reducer = TestReducer (
674
- Reduce ( withDependencies ( prepareDependencies) { reducer ( ) } ) , initialState: initialState
675
- )
676
672
self . _environment = . init( wrappedValue: ( ) )
677
673
self . file = file
678
674
self . fromScopedAction = fromScopedAction
679
675
self . line = line
680
676
self . reducer = reducer
681
- self . store = Store ( initialState: initialState , reducer: reducer)
677
+ self . store = Store ( initialState: reducer . state , reducer: reducer)
682
678
self . timeout = 100 * NSEC_PER_MSEC
683
679
self . toScopedState = toScopedState
684
680
self . dependencies = dependencies
@@ -708,22 +704,18 @@ public final class TestStore<State, Action, ScopedState, ScopedAction, Environme
708
704
Environment == Void
709
705
{
710
706
var dependencies = DependencyValues . _current
711
- prepareDependencies ( & dependencies )
712
- let initialState = withDependencies {
707
+ let reducer = withDependencies {
708
+ prepareDependencies ( & dependencies )
713
709
$0 = dependencies
714
710
} operation: {
715
- initialState ( )
711
+ TestReducer ( Reduce ( reducer ( ) ) , initialState: initialState ( ) )
716
712
}
717
-
718
- let reducer = TestReducer (
719
- Reduce ( withDependencies ( prepareDependencies) { reducer ( ) } ) , initialState: initialState
720
- )
721
713
self . _environment = . init( wrappedValue: ( ) )
722
714
self . file = file
723
715
self . fromScopedAction = { $0 }
724
716
self . line = line
725
717
self . reducer = reducer
726
- self . store = Store ( initialState: initialState , reducer: reducer)
718
+ self . store = Store ( initialState: reducer . state , reducer: reducer)
727
719
self . timeout = 100 * NSEC_PER_MSEC
728
720
self . toScopedState = { $0 }
729
721
self . dependencies = dependencies
0 commit comments