Relative Content

Tag Archive for swiftswiftuixctestswift-concurrency

swift testing ObservableObject and waiting for async operation before assertions

I am trying to test an observable object. This will make a network request which I have mocked out with dependency injection. The problem I am facing is even though i am awaiting my async function to finish, my assertion in my unit test triggers before setting my published properties. I am for sure missing something but just want any advice to clean up my view model or my tests.