File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -124,11 +124,18 @@ class ObservableStoreDispatchTests: XCTestCase {
124124 )
125125 }
126126
127- func testSerialDispatchWithCollect( ) throws {
127+ func testSerialDispatchWithCollectWithSideEffects( ) throws {
128+ var sideEffected = " "
129+
128130 let store = BaseStore (
129131 state: " " ,
130132 reducer: reducer,
131133 thunk: thunk,
134+ sideEffect: . init {
135+ $0. flatMap { [ $0, $0] } . forEach {
136+ sideEffected += $0
137+ }
138+ } ,
132139 publishOn: ImmediateScheduler . shared
133140 )
134141
@@ -163,5 +170,10 @@ class ObservableStoreDispatchTests: XCTestCase {
163170 try wait ( for: refinedActionsRecorder. next ( ) , timeout: 10 ) ,
164171 value. map { String ( $0) }
165172 )
173+
174+ XCTAssertEqual (
175+ sideEffected,
176+ value. map { String ( $0) + String( $0) } . joined ( )
177+ )
166178 }
167179}
You can’t perform that action at this time.
0 commit comments