add fail spec and only run mac ci

This commit is contained in:
Shelley Vohr 2017-12-10 12:52:03 -05:00
parent becabdfff2
commit 8a24733ee6
No known key found for this signature in database
GPG key ID: F13993A75599653C

View file

@ -36,6 +36,10 @@ describe('systemPreferences module', () => {
})
describe('systemPreferences.registerDefaults(defaults)', () => {
before(function () {
if (process.platform !== 'darwin') this.skip()
})
it('registers defaults', () => {
const userDefaults = {
'one': 'onee',
@ -50,6 +54,14 @@ describe('systemPreferences module', () => {
const val = systemPreferences.getUserDefault('two', 'string')
assert.equal(val, 'twoo')
})
it('throws when bad defaults are passed', () => {
const userDefaults = 1
assert.throws(() => {
systemPreferences.setUserDefault(userDefaults)
}, `Unable to parse userDefaults dict`)
})
})
describe('systemPreferences.getUserDefault(key, type)', () => {