Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app.stop hangs if node integration is disabled #347

Open
hacdias opened this issue Feb 1, 2019 · 1 comment
Open

app.stop hangs if node integration is disabled #347

hacdias opened this issue Feb 1, 2019 · 1 comment

Comments

@hacdias
Copy link

hacdias commented Feb 1, 2019

Hey!

We have an application with two windows and one of them has nodeIntegration set to false. Then, when calling app.stop on the tests, it just hangs and isn't able to close the application.

Although, if I enable node integrations, everything works as expected. Right now, we're just using this snipped (nodeIntegration: process.env.NODE_ENV === 'test') so our tests pass.

I wonder if this is the expected behavior or not. I took a look at your docs about this but couldn't find anything regarding this matter.

@hacdias hacdias changed the title app.stop hangs if nodeIntegration is set to false app.stop hangs if node integration is disabled Feb 1, 2019
@lt-mayonesa
Copy link

Hey! same issue here, it seems to be expected behavior. When calling Application.stop() the following happens:

   if (self.api.nodeIntegration) {
      self.client.windowByIndex(0).electron.remote.app.quit().then(endClient, reject)
    } else {
      self.client.windowByIndex(0).execute(function () {
        window.close()
      }).then(endClient, reject)
    }

https://github.com/electron/spectron/blob/f741ee1f47d2983d948bdadeba263e9a7957d4eb/lib/application.js#L72

I ended up using the same work around as you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants