Skip to content

Commit

Permalink
Don't wrap RenderTestContext's sink signals in a Worker
Browse files Browse the repository at this point in the history
This causes test failures due to unexpected Workers getting encountered.
Instead, subscribe to the signal like we used to in `subscribe()`.
  • Loading branch information
AquaGeek committed Apr 27, 2020
1 parent 634db66 commit a02a2ec
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions swift/WorkflowTesting/Sources/WorkflowRenderTester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,13 @@ fileprivate final class RenderTestContext<T: Workflow>: RenderContextType {
let sink = Sink<Action> { action in
observer.send(value: AnyWorkflowAction(action))
}
awaitResult(for: signal.asWorker(key: "\(actionType)")) { output in
return output
}

signal
.take(during: lifetime)
.observeValues { [weak self] action in
self?.apply(action: action)
}

return sink
}

Expand Down

0 comments on commit a02a2ec

Please sign in to comment.