Skip to content

Commit

Permalink
fix: emit the browser_start when we reconnect after a lost socket con…
Browse files Browse the repository at this point in the history
…nection to mimic the emit that occurs within onStart when the same state is set (karma-runner#3359)
  • Loading branch information
semanio committed May 20, 2020
1 parent 16010eb commit f587b69
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ class Browser {
this.log.debug(`Lost socket connection, but browser continued to execute. Reconnected ` +
`on socket ${newSocket.id}.`)
this.setState(EXECUTING)
//!!! Since we lost connection but are executing make sure the browser_start event is triggered for reporting, etc.
this.emitter.emit('browser_start', this)
} else if ([CONNECTED, CONFIGURING, EXECUTING].includes(this.state)) {
this.log.debug(`Rebinding to new socket ${newSocket.id} (already have ` +
`${this.getActiveSocketsIds()})`)
Expand Down

0 comments on commit f587b69

Please sign in to comment.