cypress-split
cypress-split copied to clipboard
List of specs not supporting wildcards
I'm having an issue with the following command:
$ SPEC="cypress\folder1\**\*.spec.ts, cypress\folder2\**\*.spec.ts" npx cypress run --env split=1,splitIndex1=1
The command is not working as expected. It seems to skip all files, stating that no files were found. I'm not sure if I'm doing something wrong or if it's not supported to use wildcards in the list of specs.
Additional information:
- Cypress version: 12.10.0
- Cypress-Split version: 1.20.1
- Operating System: Windows 10 22H2
Any help would be appreciated.
I ran into this too. I'm not sure how it's supposed to work. Is the cyress arg -spec supposed to show up in the config object? Might be that config object value for spec is not a string, but an object with two strings.
I ran into this too. I'm not sure how it's supposed to work. Is the cyress arg -spec supposed to show up in the config object? Might be that config object value for spec is not a string, but an object with two strings.
I fixed my issue by moving spec to the env:
cypress run --env 'spec=cypress/integration/local/**/*.js'
I have tested the SPEC wildcards in https://github.com/bahmutov/cypress-split/pull/260 and they work on Mac and Linux. You could try debugging it by running with DEBUG=cypress-split variable to see the debug output
@bahmutov The issue appears to be related to the use of backslashes in the spec filter. When forward slashes are used, cypress-split functions correctly. This seems to be a problem unique to Windows. A potential solution could be to implement path.posix.resolve to ensure that the type of slashes used does not cause any issues. https://github.com/bahmutov/cypress-split/blob/e166a56c8195db699bd2040b29747253adf3002a/src/parse-inputs.js#L106
@SebeFromGermany if this is still a problem, do you mind opening a PR with a fix?