Skip to content

Commit 3c61214

Browse files
committed
test: add askForLocationAccess() test
1 parent c6a829d commit 3c61214

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/module.spec.js

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const {
66
askForPhotosAccess,
77
askForScreenCaptureAccess,
88
askForInputMonitoringAccess,
9+
askForLocationAccess,
910
} = require('../index')
1011

1112
describe('node-mac-permissions', () => {
@@ -82,4 +83,12 @@ describe('node-mac-permissions', () => {
8283
}).to.throw(/openPreferences must be a boolean/)
8384
})
8485
})
86+
87+
describe('askForLocationAccess()', () => {
88+
it('should throw on invalid accessLevel type', () => {
89+
expect(() => {
90+
askForLocationAccess('bad-type')
91+
}).to.throw(/bad-type must be one of either 'when-in-use' or 'always'/)
92+
})
93+
})
8594
})

0 commit comments

Comments
 (0)