Skip to content

Commit

Permalink
add error case
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa committed Nov 25, 2023
1 parent c1fef21 commit 8012406
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/extensions/permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async function setAccess (simctl, udid, bundleId, permissionsMapping) {
resetPermissions.push(serviceName);
break;
default:
log.warn(`${serviceName} does not support ${permissionsMapping[serviceName]}. Please specify yes, no or unset.`);
log.errorAndThrow(`${serviceName} does not support ${permissionsMapping[serviceName]}. Please specify 'yes', 'no' or 'unset'.`);
};
}
}
Expand Down
2 changes: 2 additions & 0 deletions test/functional/simulator-e2e-specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ describe('advanced features', function () {
expect(await sim.setPermission('com.apple.Maps', 'location', 'yes')).should.not.be.rejected;
expect(await sim.setPermission('com.apple.Maps', 'location', 'no')).should.not.be.rejected;
expect(await sim.setPermission('com.apple.Maps', 'location', 'unset')).should.not.be.rejected;

expect(await sim.setPermission('com.apple.Maps', 'location', 'unsupported')).should.be.rejected;
});

it('should set and get with wix command', async function () {
Expand Down

0 comments on commit 8012406

Please sign in to comment.