How to include HealthKit entitlement in Test-Target

I'm going to test a function which fetches the heart-rate using a HKSampleQuery. The test failes with the error: Missing com.apple.developer.healthkit entitlement.


The App itself works fine. I added the entitlement to the target but I'm not able to add it to the Test-Target.

Is it possible to configure the test-target to include the same capabilities as the executable target?


I'm using Xcode Version 11.1 (11A1027) and SwiftPM as package manager. The tests are executed using the new TestPlan feature.


Thank you in advance.

Josh.