diff --git a/src/steps/decorators/steps.ts b/src/steps/decorators/steps.ts index 4d2d76a8..2500611a 100644 --- a/src/steps/decorators/steps.ts +++ b/src/steps/decorators/steps.ts @@ -8,7 +8,7 @@ import { DefineStepPattern } from '@cucumber/cucumber/lib/support_code_library_b import { buildStepDefinition } from '../../cucumber/buildStepDefinition'; import { GherkinStepKeyword } from '@cucumber/cucumber/lib/models/gherkin_step_keyword'; import { StepConfig } from '../stepConfig'; -import { buildCucumberStepCode } from '../defineStep'; +import { buildCucumberStepFn } from '../defineStep'; import { PomNode } from './class'; import { ISupportCodeLibrary } from '../../cucumber/types'; import { isBddAutoInjectFixture } from '../../run/bddFixtures/autoInject'; @@ -59,7 +59,7 @@ export function appendDecoratorSteps(supportCodeLibrary: ISupportCodeLibrary) { const fixture = getFirstNonAutoInjectFixture(fixturesArg, stepConfig); return fn.call(fixture, ...args); }; - const code = buildCucumberStepCode(stepConfig); + const code = buildCucumberStepFn(stepConfig); const stepDefinition = buildStepDefinition( { keyword, diff --git a/src/steps/defineStep.ts b/src/steps/defineStep.ts index b1266cd4..dc6ec1d4 100644 --- a/src/steps/defineStep.ts +++ b/src/steps/defineStep.ts @@ -16,10 +16,10 @@ import { getBddAutoInjectsFixtures } from '../run/bddFixtures/autoInject'; */ export function defineStep(stepConfig: StepConfig) { const { keyword, pattern } = stepConfig; - const cucumberDefineStepFn = getCucumberDefineStepFn(keyword); - const code = buildCucumberStepCode(stepConfig); + const cucumberDefineStep = getCucumberDefineStepFn(keyword); + const code = buildCucumberStepFn(stepConfig); try { - cucumberDefineStepFn(pattern, code); + cucumberDefineStep(pattern, code); } catch (e) { // todo: detect that this is import from test file // and skip/delay registering cucumber steps until cucumber is loaded @@ -35,7 +35,7 @@ export function defineStep(stepConfig: StepConfig) { } } -export function buildCucumberStepCode(stepConfig: StepConfig) { +export function buildCucumberStepFn(stepConfig: StepConfig) { // eslint-disable-next-line @typescript-eslint/no-explicit-any const code: CucumberStepFunction = function (...args: any[]) { // build the first argument (fixtures) for step fn