From 801240603622389e352361e8c5bc38864d74d1cb Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Sat, 25 Nov 2023 12:00:29 -0800 Subject: [PATCH] add error case --- lib/extensions/permissions.js | 2 +- test/functional/simulator-e2e-specs.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/extensions/permissions.js b/lib/extensions/permissions.js index 9fb9c49..8efeb84 100644 --- a/lib/extensions/permissions.js +++ b/lib/extensions/permissions.js @@ -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'.`); }; } } diff --git a/test/functional/simulator-e2e-specs.js b/test/functional/simulator-e2e-specs.js index b90f52a..23bfa54 100644 --- a/test/functional/simulator-e2e-specs.js +++ b/test/functional/simulator-e2e-specs.js @@ -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 () {