Post not yet marked as solved
Post marked as unsolved with 1 replies, 742 views
I am trying to create a document-based (macOS) app using SwiftUI and SwiftData. I'm trying to set up XCTests to validate my model behaviors.
Clearly, I need to set up a container in my test class for my model objects. Failing to do so shows that SwiftData is trying: my app launches into the New Document dialog; if I dismiss it, the app fails with a "failed to find an active container" for my model object.
Any pointer on setting up a container and context within XCTest is welcome. TIA