fix: Use app.quit instead of process.exit to prevent crash on close (#17774)

This commit is contained in:
Chris Breiding
2021-08-17 14:36:17 -04:00
committed by GitHub
parent 3973c3395f
commit ff3328669c
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -18,7 +18,7 @@ module.exports = {
return os.platform() === 'darwin'
},
getWindowArgs (state, options = {}) {
getWindowArgs (state) {
const common = {
backgroundColor: '#dfe2e4',
width: state.appWidth || 800,
@@ -51,7 +51,7 @@ module.exports = {
return Windows.showAll()
},
onClose () {
return process.exit()
app.quit()
},
}
@@ -25,11 +25,11 @@ describe('gui/interactive', () => {
})
context('.getWindowArgs', () => {
it('exits process when onClose is called', () => {
sinon.stub(process, 'exit')
it('quits app when onClose is called', () => {
electron.app.quit = sinon.stub()
interactiveMode.getWindowArgs({}).onClose()
expect(process.exit).to.be.called
expect(electron.app.quit).to.be.called
})
it('tracks state properties', () => {