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 · 2 comments

Comments

2 participants
@bahmutov
Copy link
Collaborator

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 bahmutov added the pkg/server label Apr 12, 2019

@bahmutov

This comment has been minimized.

Copy link
Collaborator Author

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

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 12, 2019

cannot trust those users like me, defensive programming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.