karma-runner / karma-runner/karma

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

Open
#2,874 4 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 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.
```shell
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.

```shell
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.