Skip to content

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

@bahmutov

Description

@bahmutov

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions