Use resources in unit tests with Swift Package Manager
I'm trying to use a resource file in unit tests and access it with Bundle.path , but it returns nil. This call in MyProjectTests.swift returns nil: Bundle(for: type(of: self)).path(forResource: "TestAudio", ofType: "m4a") Here is my project hierarchy. I also tried moving TestAudio.m4a to a Resources folder: ├── Package.swift ├── Sources │ └── MyProject │ ├── ... └── Tests └── MyProjectTests ├── MyProjectTests.swift └── TestAudio.m4a Here is my package description: // swift-tools-version:4.0 import PackageDescription let package = Package( name: "MyProject", products: [ .library( name: