Skip to content

Commit

Permalink
refactor: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Apr 11, 2024
1 parent c0aa39e commit a4ce9f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/steps/decorators/steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/steps/defineStep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a4ce9f3

Please sign in to comment.