test: test setPath for errors thrown (#22626)

This commit is contained in:
Shelley Vohr 2020-03-10 16:03:52 +00:00 committed by GitHub
parent b21c84204b
commit b607cfa220
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -712,6 +712,14 @@ describe('app module', () => {
})
describe('setPath(name, path)', () => {
it('throws when a relative path is passed', () => {
const badPath = 'hey/hi/hello'
expect(() => {
app.setPath('music', badPath)
}).to.throw(/Path must be absolute/)
})
it('does not create a new directory by default', () => {
const badPath = path.join(__dirname, 'music')
@ -723,6 +731,16 @@ describe('app module', () => {
})
})
describe('setAppLogsPath(path)', () => {
it('throws when a relative path is passed', () => {
const badPath = 'hey/hi/hello'
expect(() => {
app.setAppLogsPath(badPath)
}).to.throw(/Path must be absolute/)
})
})
describe('select-client-certificate event', () => {
let w: BrowserWindow