-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI filtering --spec
with glob pattern does not find spec files
#16102
Comments
I can recreate this issue as described. This error is thrown here if someone wants to walk back to find why this doesn't work. https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/modes/run.js#L1569:L1569 CLI is historically not great with handling odd characters. |
--spec
with glob pattern does not find spec files
I am experiencing the same issue. Although, my glob pattern looks like this:
This is the log:
|
Having a bit of time during this beginning of the year, I took a deeper look at this issue which seems to still be ongoing for the latest version released (9.2.0). On the topic of globs, I'd also like to suggest a documentation update surrounding the usage of double quotes. Particularly this snippet Run tests within the folder matching the glob (Note: Using double quotes is strongly recommended). (which can be found at https://docs.cypress.io/guides/guides/command-line#cypress-run) doesn't hold true when the pattern submitted has exclamation mark. |
@hang-up Yah, the note about double quotes is mostly for Windows users as weird things happen when they don't add double quotes generally. |
The code for this is done in cypress-io/cypress#19557, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior
Given the following folder structure:
I'd like to trigger cypress with
cypress run
targeting only the two spec files highlighted. One glob pattern tested from here gives the right result.However, when triggering from the command line with
npx cypress run --spec 'cypress/integration/{[!fix]*.spec.js,!(_unit)/**/[!fix]*.spec.js}'
, I get the messageDesired behavior
Cypress should find & run the two specs highlighted in the snippet above.
Test code to reproduce
npx cypress run --spec 'cypress/integration/{[!fix]*.spec.js,!(_unit)/**/[!fix]*.spec.js}'
Versions
Cypress 6.5.0 (Upgrade to Cypress 7 impossible atm, as the project has tied dependencies)
Mac OS 10.15.7
The text was updated successfully, but these errors were encountered: