docs: fix app.getPath types so that "name" is a string enum (#19480)

* docs: fix app.getPath types so that "name" is a string enum

Fixes https://github.com/electron/typescript-definitions/issues/140

* Update app.md
This commit is contained in:
Samuel Attard 2019-07-26 16:11:22 -07:00 committed by GitHub
parent 504407c5df
commit 48f2807473
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 24 deletions

View file

@ -683,7 +683,7 @@ describe('app module', () => {
it('throws an error when the name is invalid', () => {
expect(() => {
app.getPath('does-not-exist')
app.getPath('does-not-exist' as any)
}).to.throw(/Failed to get 'does-not-exist' path/)
})
@ -701,7 +701,7 @@ describe('app module', () => {
app.setPath('music', badPath)
expect(fs.existsSync(badPath)).to.be.false
expect(() => { app.getPath(badPath) }).to.throw()
expect(() => { app.getPath(badPath as any) }).to.throw()
})
})