-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(test): extract proxy into a separate Given claim (#3492)
First step to simplify execKarma method, which is overcomplicated and has too many responsibilities.
- Loading branch information
Showing
4 changed files
with
81 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
const { After } = require('cucumber') | ||
|
||
After(function (scenario, callback) { | ||
const running = this.child != null && typeof this.child.kill === 'function' | ||
After(async function () { | ||
await this.proxy.stopIfRunning() | ||
|
||
// stop the proxy if it was started | ||
this.proxy.stop(() => { | ||
if (running) { | ||
this.child.kill() | ||
this.child = null | ||
} | ||
callback() | ||
}) | ||
const running = this.child != null && typeof this.child.kill === 'function' | ||
if (running) { | ||
this.child.kill() | ||
this.child = null | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters