Skip to content

Commit

Permalink
Replace 2 instances of regex with cucumber expression (#1873)
Browse files Browse the repository at this point in the history
* Replace 2 instance of regex with cucumber expression

* Fixing linting issues

* Optimizing const string

* Making Prettier: from " to '
  • Loading branch information
karlajusten authored Dec 30, 2021
1 parent 385c262 commit bfce8b2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions features/step_definitions/cli_steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ When(
)

When(
/^I run cucumber-js with arguments `(|.+)` and env `(|.+)`$/,
'I run cucumber-js with arguments `{}` and env `{}`',
{ timeout: 10000 },
async function (this: World, args: string, envString: string) {
const renderedArgs = Mustache.render(valueOrDefault(args, ''), this)
Expand All @@ -41,7 +41,7 @@ When(
)

When(
/^I run cucumber-js with env `(|.+)`$/,
'I run cucumber-js with env `{}`',
{ timeout: 10000 },
async function (this: World, envString: string) {
const env = this.parseEnvString(envString)
Expand All @@ -50,7 +50,18 @@ When(
)

When(
/^I run cucumber-js with all formatters(?: and `(|.+)`)?$/,
'I run cucumber-js with all formatters',
{ timeout: 10000 },
async function (this: World) {
const args = '--format html:html.out --format json:json.out'
const renderedArgs = Mustache.render(args, this)
const stringArgs = stringArgv(renderedArgs)
return await this.run(this.localExecutablePath, stringArgs)
}
)

When(
'I run cucumber-js with all formatters and `{}`',
{ timeout: 10000 },
async function (this: World, args: string) {
if (doesNotHaveValue(args)) {
Expand Down

0 comments on commit bfce8b2

Please sign in to comment.