Skip to content
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

Cypress encountered an error while parsing the argument: --spec #22732

Open
F3n67u opened this issue Jul 11, 2022 · 3 comments · May be fixed by #29188
Open

Cypress encountered an error while parsing the argument: --spec #22732

F3n67u opened this issue Jul 11, 2022 · 3 comments · May be fixed by #29188
Labels
E2E Issue related to end-to-end testing good first issue Good for newcomers Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug

Comments

@F3n67u
Copy link

F3n67u commented Jul 11, 2022

Current behavior

I made a mistake to pass an empty string to the --browser option of cypress run, but the error message says that I pass a wrong --spec option, this is very confusing.

$ npx cypress run --browser  --spec "cypress/integration/1-getting-started/todo.spec.js" 

[95081:0711/163933.485060:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[95081:0711/163933.485081:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
[95081:0711/163933.485088:ERROR:node_bindings.cc(276)] Most NODE_OPTIONs are not supported in packaged apps. See documentation for more details.
Cypress encountered an error while parsing the argument: --spec

You passed: true

The error was: spec must be a string or comma-separated list

Desired behavior

In this situation, cypress should say that the value of --browser options is not valid.say

Test code to reproduce

$ npx cypress run --browser  --spec "cypress/integration/1-getting-started/todo.spec.js" 

Cypress Version

10.3.0

Other

$ npx cypress -v                                                                         
Cypress package version: 10.3.0
Cypress binary version: 10.3.0
Electron version: 18.3.0
Bundled Node version: 16.13.2
@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jul 11, 2022
@BlueWinds
Copy link
Contributor

That is rather strange. Repro is pretty easy, exactly as described (given spec doesn't have to exist). Looks like something in our CLI is getting confused by --browser --spec - we could probably throw a more useful error. Pull requests welcome, but I doubt the team will prioritize this.

@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: investigating Someone from Cypress is looking into this labels Jul 12, 2022
@BlueWinds BlueWinds removed their assignment Jul 13, 2022
@mschile mschile added triage and removed triage labels Aug 18, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. and removed routed-to-e2e labels Apr 19, 2023
@mschile
Copy link
Contributor

mschile commented May 18, 2023

We use the commander package and this is the default behavior. I believe we would have to write custom parsers for the options to handle this use-case.

@lunaautomation
Copy link

I am going to give this one a try 👋

@lunaautomation lunaautomation linked a pull request Mar 22, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing good first issue Good for newcomers Triaged Issue has been routed to backlog. This is not a commitment to have it prioritized by the team. type: bug
Projects
None yet
6 participants