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)', () => {
|
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', () => {
|
it('does not create a new directory by default', () => {
|
||||||
const badPath = path.join(__dirname, 'music')
|
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', () => {
|
describe('select-client-certificate event', () => {
|
||||||
let w: BrowserWindow
|
let w: BrowserWindow
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue