Unit test code should not be subject to permission checking

Unit test code should not be subject to permission checking as unit tests will never run on the actual device.

In one of my data fields I'm working on I wanted to test my distance calculation, but it's throwing a permission required error (Positioning permission)

Expected behaviour: In the ideal world all code within the unit test code should not be subject to any permission checking at all.

Code to reproduce:
(:test)
function verifyDistanceCalculation(logger) {
var locString = "51.5, 0";
var location1 = Position.parse(locString, Position.GEO_DEG);

/**var location1 = new Position.Location(
{
:latitude => 51.5,
:longitude => 0,
:format => :degrees
}*/
return true;
}
  • Former Member
    Former Member
    Hey Peter,

    I've got a ticket created to investigate the intended results. I believe it's behaving as expected, but I think it's worth looking at.

    Thanks,
    -Coleman
  • Former Member
    Former Member
    Hey,

    After some further discussion with the team, this is the intended result. Testing against app specified permissions is one of the benefits of our current test system in that it lets developers know if they haven't configured their permissions correctly.

    Thanks,
    -Coleman