We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RxSwift includes and useful operator that transform any observable into a blocking sequence.
For Combine it'll be really useful being able to implement the same behavior. Here's how it works on RxSwift http://rx-marin.com/post/rxblocking-part1/
I got something working using current code but it's far from ready, it may help us getting the idea of the expected behavior:
let testScheduler = TestScheduler() let publisher = TestPublisher<Int, TestError>.init { subscriber in subscriber.receive(1) subscriber.receive(2) } let configuration = TestScheduler.Configuration(pausedOnStart: false, created: 0, subscribed: 0, cancelled: 1, subscriberOptions: TestableSubscriberOptions(initialDemand: Subscribers.Demand.unlimited, subsequentDemand: Subscribers.Demand.unlimited, demandReplenishmentDelay: 0, negativeBalanceHandler: { })) let testableSubscriber = testScheduler.start(configuration: configuration) { publisher } XCTAssertEqual(testableSubscriber.sequence, [ (0, .input(1)), (0, .input(2)), (0, .subscription), ])
The expected behavior would be:
let publisher = TestPublisher<Int, TestError>.init { subscriber in subscriber.receive(1) subscriber.receive(2) } let blockingPublisher = publisher.toBlocking() XCTAssertEqual(blockingPublisher.sequence, [1, 2])
This will allow testing Combine publishers in libraries like https://github.com/bitomule/CombineRealm
Here's the RxSwift implementation: https://github.com/ReactiveX/RxSwift/tree/master/RxBlocking
The text was updated successfully, but these errors were encountered:
@bitomule @tcldr FYI https://github.com/groue/CombineExpectations
Sorry, something went wrong.
No branches or pull requests
RxSwift includes and useful operator that transform any observable into a blocking sequence.
For Combine it'll be really useful being able to implement the same behavior. Here's how it works on RxSwift http://rx-marin.com/post/rxblocking-part1/
I got something working using current code but it's far from ready, it may help us getting the idea of the expected behavior:
The expected behavior would be:
This will allow testing Combine publishers in libraries like https://github.com/bitomule/CombineRealm
Here's the RxSwift implementation: https://github.com/ReactiveX/RxSwift/tree/master/RxBlocking
The text was updated successfully, but these errors were encountered: