codeceptjs / codeceptjs/CodeceptJS
`run-multiple` command picks 0 feature files when `-c` CLI option is specified
- Dominant language
- JavaScript
- Stars
- 4.2k
- Forks
- 757
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 16
Description
Let's assume we have `codecept.conf.js` config file in the project root with the following config:
```js
exports.config = {
// other options go here
multiple: {
basic: {
browsers: ['chromium', 'firefox'],
},
},
gherkin: {
features: './features/*.feature',
steps: ['./step_definitions/steps.js'],
}
};
```
When running tests with:
```bash
codeceptjs run-multiple --all
```
all specified feature files are executed as expected.
However, when the `-c` CLI option is explicitly provided:
```bash
codeceptjs run-multiple --all -c codecept.conf.js
```
the command fails to identify and run the specified glob for the feature files, resulting in 0 features being picked.
**Root cause:**
The issue occurs due to the usage of `path.resolve` on paths when a custom configuration file is specified [here](https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/command/run-multiple.js#L74). This results in invalid input for the `globSync` command, causing it to fail to resolve the glob patterns correctly [here](https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/codecept.js#L175).
Contributor guide
Assessment
This issue has not been assessed yet.