Skip to content

Commit

Permalink
refactor: rename StepDefinition.code to fn to be consistent with options
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalets committed Oct 23, 2024
1 parent b115b8a commit 5f41a2e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gen/testFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export class TestFile {
// fixtures are accessible via this.world
if (stepDefinition.isCucumberStyle()) return [];

return fixtureParameterNames(stepDefinition.code) // prettier-ignore
return fixtureParameterNames(stepDefinition.fn) // prettier-ignore
.filter((name) => !isBddAutoInjectFixture(name));
}

Expand Down
2 changes: 1 addition & 1 deletion src/run/StepInvoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class StepInvoker {
// some projects request it for better migration process from cucumber.
// Here, for pw-style we pass empty object as world.
// See: https://github.com/vitalets/playwright-bdd/issues/208
return stepDefinition.code.call(this.bddContext.world, fixturesArg, ...parameters);
return stepDefinition.fn.call(this.bddContext.world, fixturesArg, ...parameters);
});
}

Expand Down
3 changes: 1 addition & 2 deletions src/steps/stepDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ export class StepDefinition {
return this.options.pattern;
}

// todo: rename to fn to be consistent with options?
get code() {
get fn() {
return this.options.fn;
}

Expand Down

0 comments on commit 5f41a2e

Please sign in to comment.