Skip to content

Commit

Permalink
fix: Use app.quit instead of process.exit to prevent crash on close (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Aug 17, 2021
1 parent 3973c33 commit ff33286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/server/lib/modes/interactive-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
return os.platform() === 'darwin'
},

getWindowArgs (state, options = {}) {
getWindowArgs (state) {
const common = {
backgroundColor: '#dfe2e4',
width: state.appWidth || 800,
Expand Down Expand Up @@ -51,7 +51,7 @@ module.exports = {
return Windows.showAll()
},
onClose () {
return process.exit()
app.quit()
},
}

Expand Down
6 changes: 3 additions & 3 deletions packages/server/test/unit/modes/interactive_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down

4 comments on commit ff33286

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ff33286 Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.3.1/circle-develop-ff3328669c87ab8da2b3ca2ff4e7461d7c9f0bca/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ff33286 Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.3.1/appveyor-develop-ff3328669c87ab8da2b3ca2ff4e7461d7c9f0bca/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ff33286 Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.3.1/appveyor-develop-ff3328669c87ab8da2b3ca2ff4e7461d7c9f0bca/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on ff33286 Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/8.3.1/circle-develop-ff3328669c87ab8da2b3ca2ff4e7461d7c9f0bca/cypress.tgz

Please sign in to comment.