Testing SwiftUI and Combine: The State of the Art
summary
Refactors a small weather app from RxSwift + UIKit to Combine + SwiftUI and shows what actually required testing work: a recorder subscriber to capture Combine emissions, custom test scheduler and assertions to simulate virtual time, and URLProtocol mocking for network responses. Location provider, API decode and view model tests translate almost one‑to‑one and pass, but SwiftUI button interaction needs an XC hack based on the old cavy runtime. Combine production code is easy to port, but Apple omits test helpers so several weekend‑sized test utilities are necessary.
AI-written summary · about
chapters (7)
- 0:00The importance of testing
- 1:52Refactoring overview
- 4:24Testing location providers
- 9:00Weather API testing
- 12:28View model testing
- 17:07View and UI testing
- 26:27Conclusion and Q&A
related talks
43mBeware Combine!
36mTesting Asynchronous Code in Swift 5.5
32mVenturing Into the world of RxSwift unit testing
38mTesting and Declarative UI's
30mUnlocking the Power of Swift Testing: Modern Approaches to Testing iOS Apps
46mSqueezing Even More Out of SwiftUI Preview
37miOS Testing: Beyond the Model
29mThe Magic of UI Testing
