You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble with the linter when it comes to keeping the linting rules contained to a single folder, stepDefinitions with the exact same name in one feature folder will say that is is a valid step in a different feature.
It's frustrating because I want it to be scoped and this would help me catch errors earlier on in my development.
If I have a folder for view and a folder for create. I want my stepDefinitions to be scoped to those folders. E.g. view/view.feature might have the stepDefinition Given the "view" heading is displayed and create/create.feature might have the stepDefinition Given the "create" heading is displayed.
If I have the definition implemented in view/view.ts (Given("the {string} heading is displayed", ...)), this should satisfy the linter for the view.feature file and that alone, I EXPECT the create.feature stepDefinition to still be undefined, however it is picking up the file from the view.
✨ What's your proposed solution?
My pre-processor picks up this scoped way of working with the following config in locating step definitions:
kieran-ryan
changed the title
Can the cucumber linting stepDefinitions be scoped like my pre-processor scopes files?
Scoping for undefined steps within different step definition file paths
Jan 3, 2024
🤔 What's the problem you're trying to solve?
I'm having trouble with the linter when it comes to keeping the linting rules contained to a single folder, stepDefinitions with the exact same name in one feature folder will say that is is a valid step in a different feature.
It's frustrating because I want it to be scoped and this would help me catch errors earlier on in my development.
Currently I have this setup for the workspace:
If I have a folder for
view
and a folder forcreate
. I want my stepDefinitions to be scoped to those folders. E.g.view/view.feature
might have the stepDefinitionGiven the "view" heading is displayed
andcreate/create.feature
might have the stepDefinitionGiven the "create" heading is displayed
.If I have the definition implemented in
view/view.ts
(Given("the {string} heading is displayed", ...)
), this should satisfy the linter for theview.feature
file and that alone, I EXPECT thecreate.feature
stepDefinition to still be undefined, however it is picking up the file from the view.✨ What's your proposed solution?
My pre-processor picks up this scoped way of working with the following config in locating step definitions:
However I can't apply that
[filepath]
method to thevscode
extension settings because it doesn't do anything.⛏ Have you considered any alternatives or workarounds?
Right now I'm just dealing with it.
📚 Any additional context?
Maybe this is a feature that already exists, but it isn't documented anywhere.
The text was updated successfully, but these errors were encountered: