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

Karma should start a new browser instance when disconnected by a SyntaxError #2874

Open
BebeSparkelSparkel opened this issue Nov 12, 2017 · 4 comments

Comments

@BebeSparkelSparkel
Copy link

Expected behaviour

I would expect that karma would close the current connection and automatically launch another browser instance when it sees another change in the files that it is watching.

HeadlessChrome 0.0.0 (Mac OS X 10.11.6) ERROR
  Uncaught SyntaxError: Unexpected identifier
  at event_sequencing.js:52


HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 0 of 5 SUCCESS (0 secs / 0 secs)
HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 5 of 5 SUCCESS (0.012 secs / 0.005 secs)
12 11 2017 08:26:17.933:INFO [watcher]: Changed file "/Users/williamrusnack/Documents/event_sequencing/test.js".

Actual behaviour

Karma instead continues to try and connect to the disconnect browser session when it knows that it has lost the connection.

HeadlessChrome 0.0.0 (Mac OS X 10.11.6) ERROR
  Uncaught SyntaxError: Unexpected identifier
  at event_sequencing.js:52


HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 0 of 5 SUCCESS (0 secs / 0 secs)
HeadlessChrome 0.0.0 (Mac OS X 10.11.6) ERROR
  Disconnected, because no message in 10000 ms.
HeadlessChrome 0.0.0 (Mac OS X 10.11.6): Executed 0 of 5 DISCONNECTED (10.005 secs / 0 secs)
12 11 2017 08:44:02.222:INFO [watcher]: Changed file "/Users/williamrusnack/Documents/event_sequencing/test.js".
12 11 2017 08:44:02.480:WARN [karma]: No captured browser, open http://localhost:9876/

Environment Details

HeadlessChrome 0.0.0 (Mac OS X 10.11.6)
Karma version: 1.7.1

Steps to reproduce the behaviour

Include any syntax error in the javascript test file or the file to be tested that causes the browser to disconnect.

@EzraBrooks
Copy link
Collaborator

Can you clarify what the core issue is here? It seems like you're talking about both the browser disconnecting on SyntaxError and the test runner not properly watching files if the disconnection occurs.

@BebeSparkelSparkel
Copy link
Author

The core issue is that I need to manually restart the karma process when there is a syntax error.

I think karma should be able to handle a file having a syntax error and continue to be able to run tests.

@EzraBrooks EzraBrooks changed the title DISCONNECTED if javascript has a SyntaxError Karma should start a new browser instance when disconnected by a SyntaxError Nov 25, 2017
@EzraBrooks
Copy link
Collaborator

Thanks for the feedback!

@BebeSparkelSparkel
Copy link
Author

NP

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

No branches or pull requests

2 participants