How to enable permission for unit tests?

How to enable permission for unit tests? 

I want to test a full scope of my watch face. How can I enable permissions for the unit tests? 

More specifically, I need next permissions to be enabled while doing tests: Positioning, Background, Communications

Thanks for a guidance. Didn't find it in the doc. 

  • I think the unit test framework was intended to be used to unit test your app code, not so much the API code. This is probably an oversimplification of what users actually want/need.

    If we aren't already doing it, we should be using the permissions from the manifest when doing unit test builds. Without them it would be impossible to unit test a class that used something like Position.Location. For cases like that you'd need to provide a type stub.

  • Now the unit tests do not respect the permissions. E. g. a unit test of ServiceDelegate mock throws: 

    Error: Permission Required

    Details: Module 'Toybox.Communications' not available to 'Watch Face'

    Even when the Communications permission is requested in the manifest.