Unit Testing with Core Data in Xcode 12

I'm trying to write a unit test for a Core Data model in Xcode 12 Beta 4 for a multiplatform app. However, it looks like it's unable to find the managed object model. The following returns nil:

Code Block swift
let container = NSPersistentContainer(name: "MyModelName")

This works fine in Xcode 11 for an iOS app. I also tried getting the model explicitly from the bundle, but that doesn't seem to work either.

Any ideas on how to fix this?
Not without more information, for example what bundle / target is that code executing in? If its your test target you'll need to look up the app's bundle to find the momd.
Unit Testing with Core Data in Xcode 12
 
 
Q