fix: create missing directories with app.setPath (#18244)

This commit is contained in:
Shelley Vohr 2019-05-28 10:37:54 -07:00 committed by GitHub
parent 1688ebdd40
commit c621615112
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View file

@ -667,6 +667,18 @@ describe('app module', () => {
})
})
describe('setPath(name, path)', () => {
it('does not create a new directory by default', () => {
const badPath = path.join(__dirname, 'music')
expect(fs.existsSync(badPath)).to.be.false
app.setPath('music', badPath)
expect(fs.existsSync(badPath)).to.be.false
expect(() => { app.getPath(badPath) }).to.throw()
})
})
describe('select-client-certificate event', () => {
let w: BrowserWindow