Write unit tests for ObservableObject ViewModels with Published results
问题 Today again one combine problem I currently run in and I hope that someone of you can help. How can normal unit tests be written for ObservableObjects classes which contain @Published attributes? How can I subscribe in my test to them to get the result object which I can assert? The injected mock for the web service works correctly, loadProducts() function set exactly the same elements from the mock in the fetchedProducts array. But I don't know currently how to access this array in my test