When I try to build the preview, if there are any test targets in the project that the view file belongs to, it builds them all. I just checked.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: