Stop Sleeping ThroughYour Async Tests

Or how to structure your code for better testing of asynchronous view models and service.

Stop Sleeping ThroughYour Async Tests

Or how to structure your code for better testing of asynchronous view models and service.

Michael Long
Michael Long in The Swift Cooperative
  ∙  
April 27, 2026
  ∙  
10 min read
Member-only content
  ∙  
View on Medium
Photo by Vitaly Gariev on Unsplash

Photo by Vitaly Gariev on Unsplash

The codebase we’re going to be discussing today is MovieDemo, a SwiftUI application I created to show how Factory and Navigator can be used in a modern modular codebase.

Factory handles dependency injection without turning the app into a junk drawer. Navigator handles navigation as application structure, not as random NavigationLink confetti sprayed through views.

The point of the project is not merely to display movie data. It’s to demonstrate how a SwiftUI application can be decomposed into testable, replaceable, feature-oriented pieces.

And that brings us to the part most demo apps conveniently ignore.

Testing.

Specifically, testing view models that…

Continue reading
This is a member-only story and can only be read on Medium.
Download the Medium app
Sent to sikubaycom.s3cr3tz@blogger.com by Michael Long on Medium
Unsubscribe from this writer's email notifications
Manage your email settings

3500 South DuPont Highway, Suite IQ-101, Dover, DE 19901
Careers·Help Center·Privacy Policy·Terms of service