Testing in RxSwift

RxTest and RxBlocking are part of the RxSwift repository but are made available via separate pods and hence require separate imports. RxTest provides useful additions for testing Rx code, including TestScheduler, which is a virtual time scheduler and methods for adding events at precise time intervals, whereas RxBlocking enables converting a regular Observable sequence to a blocking observable, which blocks the thread it's running on until the observable sequence completes or a specified timeout is reached. This makes testing asynchronous operations much easier.

Get Reactive Programming with Swift 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.