test: test setPath for errors thrown (#22626)
This commit is contained in:
parent
b21c84204b
commit
b607cfa220
1 changed files with 18 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue