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 config object passed to the plugins file should have config filename #5941

Closed
bahmutov opened this issue Dec 12, 2019 · 4 comments · Fixed by #6317
Closed

Cypress config object passed to the plugins file should have config filename #5941

bahmutov opened this issue Dec 12, 2019 · 4 comments · Fixed by #6317
Assignees

Comments

@bahmutov
Copy link
Contributor

Cypress v3.7.0

The plugins file receives resolved config object with properties from cypress.json resolved. But the config object has plugins, fixtures, integration paths - yet it does not have the project root or configuration filename. Since we have added --config-file option, we should pass it in the config object (or false is the user has disabled it)

See https://docs.cypress.io/guides/guides/command-line.html#cypress-run-config-file-lt-config-file-gt

Expected behavior with the following plugins file

module.exports = (on, config) => {
  console.log(config.configFile)
}
$ cypress run
cypress.json
$ cypress run --config-file false
false
$ cypress run --config-file my-config.json
/resolved/path/to/my-config.json
@bahmutov bahmutov added the stage: proposal 💡 No work has been done of this issue label Dec 12, 2019
@bahmutov
Copy link
Contributor Author

@jennifer-shehane
Copy link
Member

Yah, I thought this was a bit weird too when I began investigating #5855 It's a weird edge case config just like browsers and should probably follow the same implementation as that value.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 28, 2020

The code for this is done in cypress-io/cypress#6317, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Feb 28, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 28, 2020

Released in 4.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants