Skip to content

Replace 2 instances of regex with cucumber expression #1873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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