chore: add error throwing utility (#19803)
* chore: add error throwing utility * feedback from review * DRY out repeated isolate calls
This commit is contained in:
parent
8f1c51eaea
commit
43e6d7fe88
7 changed files with 118 additions and 4 deletions
|
|
@ -117,6 +117,13 @@ describe('systemPreferences module', () => {
|
|||
})
|
||||
|
||||
ifdescribe(process.platform === 'darwin')('systemPreferences.getSystemColor(color)', () => {
|
||||
it('throws on invalid system colors', () => {
|
||||
const color = 'bad-color'
|
||||
expect(() => {
|
||||
systemPreferences.getSystemColor(color as any)
|
||||
}).to.throw(`Unknown system color: ${color}`)
|
||||
})
|
||||
|
||||
it('returns a valid system color', () => {
|
||||
const colors = ['blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'yellow']
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue