From 03183b08dc70af2af407f3650e81db84b4ddafbe Mon Sep 17 00:00:00 2001 From: Karla Aparecida Justen Date: Fri, 17 Dec 2021 13:55:33 -0300 Subject: [PATCH 1/2] Replace regex with cucumber expression. We decided to split the step definition into two. So that the patterns used be simpler. Co-authored-by: Blaise Pabon Co-authored-by: Matt Wynne Co-authored-by: Dane Parchment Jr --- features/step_definitions/cli_steps.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/features/step_definitions/cli_steps.ts b/features/step_definitions/cli_steps.ts index 940907454..de617b8c0 100644 --- a/features/step_definitions/cli_steps.ts +++ b/features/step_definitions/cli_steps.ts @@ -16,7 +16,15 @@ When('my env includes {string}', function (this: World, envString: string) { }) When( - /^I run cucumber-js(?: with `(|.+)`)?$/, + 'I run cucumber-js', + { timeout: 10000 }, + async function (this: World) { + return await this.run(this.localExecutablePath, []) + } +) + +When( + 'I run cucumber-js with `{}`', { timeout: 10000 }, async function (this: World, args: string) { const renderedArgs = Mustache.render(valueOrDefault(args, ''), this) From 2ce99f407b09d4405654c776eea0ddee6b1d3d91 Mon Sep 17 00:00:00 2001 From: aurelien-reeves Date: Tue, 28 Dec 2021 08:48:57 +0100 Subject: [PATCH 2/2] Fix linting issues --- features/step_definitions/cli_steps.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/features/step_definitions/cli_steps.ts b/features/step_definitions/cli_steps.ts index de617b8c0..c015f3d49 100644 --- a/features/step_definitions/cli_steps.ts +++ b/features/step_definitions/cli_steps.ts @@ -15,13 +15,9 @@ When('my env includes {string}', function (this: World, envString: string) { this.sharedEnv = this.parseEnvString(envString) }) -When( - 'I run cucumber-js', - { timeout: 10000 }, - async function (this: World) { - return await this.run(this.localExecutablePath, []) - } -) +When('I run cucumber-js', { timeout: 10000 }, async function (this: World) { + return await this.run(this.localExecutablePath, []) +}) When( 'I run cucumber-js with `{}`',