Writing testable UI related code with modern Swift

This is not always possible, especially when you want to test an async endpoint that is stateful over time, or where you need to wiggle your way in between a method's suspension points, as I believe is the case here, and is a very common case with observable models in SwiftUI.

The three year old thread linked above has an example that I believe is still not possible to reliably test in Swift today:

1 Like