iOS Swift: Unit Testing Combine Publisher

Saad El Oulladi
3 min readOct 20, 2023

--

iOS development has undergone significant changes since the introduction of SwiftUI and Combine. Reactive programming has become a standard practice, as Combine is included in the iOS SDK by default.

Unit testing reactive code can sometimes be challenging, as the inputs and outputs are not easily obtained as in the case of imperative programming.

The boring approach

--

--