Skip to content

Commit b607cfa

Browse files
authored
test: test setPath for errors thrown (electron#22626)
1 parent b21c842 commit b607cfa

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

spec-main/api-app-spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,14 @@ describe('app module', () => {
712712
})
713713

714714
describe('setPath(name, path)', () => {
715+
it('throws when a relative path is passed', () => {
716+
const badPath = 'hey/hi/hello'
717+
718+
expect(() => {
719+
app.setPath('music', badPath)
720+
}).to.throw(/Path must be absolute/)
721+
})
722+
715723
it('does not create a new directory by default', () => {
716724
const badPath = path.join(__dirname, 'music')
717725

@@ -723,6 +731,16 @@ describe('app module', () => {
723731
})
724732
})
725733

734+
describe('setAppLogsPath(path)', () => {
735+
it('throws when a relative path is passed', () => {
736+
const badPath = 'hey/hi/hello'
737+
738+
expect(() => {
739+
app.setAppLogsPath(badPath)
740+
}).to.throw(/Path must be absolute/)
741+
})
742+
})
743+
726744
describe('select-client-certificate event', () => {
727745
let w: BrowserWindow
728746

0 commit comments

Comments
 (0)