Cypress config files should support "extends" option
See original GitHub issueDesired behavior:
TypeScript config files (tsconfig.json
) allow the user to “extend” an existing file, e.g.:
tsconfig.json
:
{
"someOption": "value",
"someOption2": "value2"
}
tsconfig.test.json
:
{
"extends": "./tsconfig.json",
"someOption": "value3"
}
The end result is that the TypeScript compiler sees tsconfig.test.json
as this:
{
"someOption": "value3",
"someOption2": "value2"
}
This allows the config files to remain DRY and avoid duplicating data, but still have multiple files for different scenarios.
Now that cypress has the --config-file
option, I think cypress.json
should support this too.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:19 (8 by maintainers)
Top Results From Across the Web
Configuration - Cypress Documentation
This file is used to store any configuration specific to Cypress. Cypress additionally supports config files with .mjs or .cjs extensions. Using a...
Read more >How to extend cypress.json config to other configuration files?
Cypress plugin that adds "extends" support to the configuration file. This allows the config files to remain DRY and avoid duplicating data, ...
Read more >Configurations in Cypress and How to Disable Default ...
Firstly, Cypress has a configuration setup, which is called the Global Configuration, which provides a set of default values for various ...
Read more >Specify Cypress configuration files - BrowserStack
You can use the cypress_config_file key in run_settings option to specify the Cypress configuration file that you want to use.
Read more >Configure Cypress Tests to Run on Multiple Environments
Most importantly we need only baseUrl changes in newly created Cypress configuration files, the remaining configuration still we can use the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Unfortunately the plugin from @bahmutov doesn’t work in my environment. This should work out of the box
@bahmutov @jennifer-shehane An extra scenario where this would be useful: in Fluent UI we have a lerna monorepo. We would like each package to be responsible for its own cypress tests, but would like to have one place for test helpers and configurations. At the same time a package should be able to extend or override the base config.
It seems too heavy weight to create a completely new package in the monorepo just to share cypress utilities, if it’s possible to do path extension