Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
using createThunkMiddleware in ExpectThunk
  • Loading branch information
obj-p committed Feb 19, 2019
commit 0bf5468c61d0e928975fc05c07a4ab82fcdbf295
8 changes: 4 additions & 4 deletions ReSwift-ThunkTests/ExpectThunk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

import XCTest
import ReSwift
import ReSwiftThunk

@testable import ReSwiftThunk

// TODO: no longer allow subclassing
public class ExpectThunk<State: StateType> {
public typealias ActionAssertion = (Action) -> Void
private var dispatch: DispatchFunction {
Expand Down Expand Up @@ -64,7 +62,9 @@ extension ExpectThunk {

extension ExpectThunk {
func run() -> XCTestExpectation {
thunk.body(dispatch, getState)
let next: DispatchFunction = { _ in }
let middleware = createThunksMiddleware()(dispatch, getState)(next)
middleware(thunk)
return expectation
}
}