mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-14 11:29:16 -05:00
fix: Use app.quit instead of process.exit to prevent crash on close (#17774)
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user