Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Added handlers to call onComplete and stop chromedriver cleanly when …
Browse files Browse the repository at this point in the history
…the process is terminated via WebdriverIO SevereServiceError. Fixes #53 (#54)
  • Loading branch information
jamesmortensen committed May 18, 2021
1 parent 508883e commit 1730480
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export default class ChromeDriverLauncher {
if (typeof this.outputDir === 'string') {
this._redirectLogStream()
}

process.on('exit', this.onComplete)
process.on('SIGINT', this.onComplete)
process.on('uncaughtException', this.onComplete)
}

onComplete() {
Expand Down

0 comments on commit 1730480

Please sign in to comment.