Description
Describe the bug
Whenever the parent directory has parentheses in its name, I noticed the cucumber features tests start to fail. I also noticed that in the tests that are run, the path for the parent directory drops the parentheses from the path name. For the above reason, the path can not be found for a specified directory.
22) Scenario: # features/usage_json_formatter.feature:8
✔ Before # ../../Cucumber x/cucumber-js/src/support_code_library_builder/build_helpers.ts:13
✔ Given a file named "features/a.feature" with: # ../../Cucumber x/cucumber-js/src/support_code_library_builder/build_helpers.ts:13
"""
Feature: a feature
Scenario: a scenario
Given step A
And step A
When step B
Then step C
"""
✔ And a file named "features/step_definitions/steps.js" with: # ../../Cucumber x/cucumber-js/src/support_code_library_builder/build_helpers.ts:13
"""
const {When} = require('@cucumber/cucumber')
When('step A', function() {});
When('step B', function() {});
When('step C', function() {});
When(/step D/, function() {});
"""
✔ When I run cucumber-js with `--format usage-json` # ../../Cucumber x/cucumber-js/src/support_code_library_builder/build_helpers.ts:13
✖ Then it outputs the usage data: # ../../Cucumber x/cucumber-js/src/support_code_library_builder/build_helpers.ts:13
| PATTERN | PATTERN_TYPE | URI | LINE | NUMBER OF MATCHES |
| step A | CucumberExpression | features/step_definitions/steps.js | 3 | 2 |
| step B | CucumberExpression | features/step_definitions/steps.js | 4 | 1 |
| step C | CucumberExpression | features/step_definitions/steps.js | 5 | 1 |
| step D | RegularExpression | features/step_definitions/steps.js | 6 | 0 |
AssertionError
+ expected - actual
-13
+3
at /Users/emmanuelola/Documents/Cucumber (x)/cucumber-js/features/step_definitions/usage_json_steps.ts:15:30
at Array.forEach (<anonymous>)
at World.<anonymous> (/Users/emmanuelola/Documents/Cucumber (x)/cucumber-js/features/step_definitions/usage_json_steps.ts:9:18)
✔ After # ../../Cucumber x/cucumber-js/src/support_code_library_builder/build_helpers.ts:13
To Reproduce
Steps to reproduce the behavior:
- Go to 'the root directory for the project'
- Add a parent directory with a parentheses in its name (include some letters within the parentheses)
- Open the project in your desired IDE
- Run the tests
- See error
Expected behavior
Passing tests
Desktop (please complete the following information):
- OS: macOS Big Sur 11.4
- Version: Main Repository Branch
Additional context
Trying to run tests to contribute to cucumber-js with @mattwynne as part of the Cucumber first timers mob and the folder where I keep my code happens to have parentheses in its name. For more context, this is not the folder shown in the screenshot, that's simply provided for testing purposes.