test: test setPath for errors thrown (#22639)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2020-03-10 10:03:36 -07:00
committed by GitHub
parent 851ed7a6e7
commit 7ee7890fd8

View File

@@ -707,6 +707,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')
@@ -718,6 +726,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