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

Argument parsing crashes badly if passing "spec: {}" #3957

Open
bahmutov opened this issue Apr 12, 2019 · 4 comments
Open

Argument parsing crashes badly if passing "spec: {}" #3957

bahmutov opened this issue Apr 12, 2019 · 4 comments

Comments

@bahmutov
Copy link
Collaborator

@bahmutov bahmutov commented Apr 12, 2019

3.2.0

Crash Cypress by using npx cypress run --spec {}

Screen Shot 2019-04-12 at 9 34 33 AM

Same using NPM module

const cypress = require('cypress')
cypress.run({
  // this works fine
  // spec: 'cypress/integration/spec.js'
  // this crashes badly - hanging Cypress
  spec: {}

  /*
    this exits because no specs were found
    Can't run because no spec files were found.
    We searched for any files matching this glob pattern:
  */
  // spec: []
})

I have created example in cypress-io/cypress-test-tiny#44

@bahmutov
Copy link
Collaborator Author

@bahmutov bahmutov commented Apr 12, 2019

On CI it shows the error message but keeps hanging https://circleci.com/gh/cypress-io/cypress-test-tiny/2120

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: strToArray(...).map is not a function
    at Object.toObject (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/lib/util/args.js:221:39)
    at Object.start (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/lib/cypress.js:70:40)
    at Object.<anonymous> (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/index.js:21:43)
    at Object.<anonymous> (/root/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/index.js:23:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)

@bahmutov
Copy link
Collaborator Author

@bahmutov bahmutov commented Apr 12, 2019

cannot trust those users like me, defensive programming

@ivanprotsykfreetour
Copy link

@ivanprotsykfreetour ivanprotsykfreetour commented Jun 5, 2019

had this issue using a glob pattern in package.json
"cy:run:local": "cypress run -spec \"cypress/integration/!(examples)**/*.spec.js\""

@duncdrum
Copy link

@duncdrum duncdrum commented Jun 17, 2019

yup running into this on travis as well. Funnily only for pull-request builds. We have CI configured to run different specs on different major versions via ENV variables.
You can see the expected result of a commit in my fork yet in the Pull-request for that commit cypress hangs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants