Explicitly skip tests that should be skipped

This commit is contained in:
Aleksei Kuzmin 2017-11-16 00:05:46 +03:00
parent 42d7d51b75
commit cf749a8e18
19 changed files with 675 additions and 262 deletions

View file

@ -4,7 +4,11 @@ const {systemPreferences} = remote
describe('systemPreferences module', () => {
describe('systemPreferences.getAccentColor', () => {
if (process.platform !== 'win32') return
before(function () {
if (process.platform !== 'win32') {
this.skip()
}
})
it('should return a non-empty string', () => {
let accentColor = systemPreferences.getAccentColor()
@ -14,7 +18,11 @@ describe('systemPreferences module', () => {
})
describe('systemPreferences.getColor(id)', () => {
if (process.platform !== 'win32') return
before(function () {
if (process.platform !== 'win32') {
this.skip()
}
})
it('throws an error when the id is invalid', () => {
assert.throws(() => {
@ -28,9 +36,11 @@ describe('systemPreferences module', () => {
})
describe('systemPreferences.getUserDefault(key, type)', () => {
if (process.platform !== 'darwin') {
return
}
before(function () {
if (process.platform !== 'darwin') {
this.skip()
}
})
it('returns values for known user defaults', () => {
const locale = systemPreferences.getUserDefault('AppleLocale', 'string')
@ -56,8 +66,6 @@ describe('systemPreferences module', () => {
})
describe('systemPreferences.setUserDefault(key, type, value)', () => {
if (process.platform !== 'darwin') return
const KEY = 'SystemPreferencesTest'
const TEST_CASES = [
['string', 'abc'],
@ -70,6 +78,12 @@ describe('systemPreferences module', () => {
['dictionary', {'a': 1, 'b': 2}]
]
before(function () {
if (process.platform !== 'darwin') {
this.skip()
}
})
it('sets values', () => {
for (const [type, value] of TEST_CASES) {
systemPreferences.setUserDefault(KEY, type, value)
@ -94,7 +108,11 @@ describe('systemPreferences module', () => {
})
describe('systemPreferences.setUserDefault(key, type, value)', () => {
if (process.platform !== 'darwin') return
before(function () {
if (process.platform !== 'darwin') {
this.skip()
}
})
it('removes keys', () => {
const KEY = 'SystemPreferencesTest'