test: test setPath for errors thrown (#22638)

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot]
2020-03-11 16:02:02 +09:00
committed by GitHub
parent 07ea340314
commit 542f30b54b

View File

@@ -736,6 +736,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')
@@ -747,6 +755,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