-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
feat: support ct/e2e specific overrides in cypress.json #15444
Changes from 7 commits
b7725f5
ce06ccb
57a0f87
b4a7823
0291af0
b70d69f
7db103a
f9e14af
0d40745
3245164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,10 @@ module.exports = { | |
}, _.cloneDeep(obj)) | ||
}, | ||
|
||
isComponentTesting (options = {}) { | ||
return options.experimentalComponentTesting || options.componentTesting || options.testingType === 'component' | ||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a lot of flags for CT, apparently... we should reduce these to just one or two eventually. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oy vey. Yeah we need to do this like ASAP. |
||
|
||
configFile (options = {}) { | ||
return options.configFile === false ? false : (options.configFile || 'cypress.json') | ||
}, | ||
|
@@ -151,6 +155,16 @@ module.exports = { | |
.catch({ code: 'ENOENT' }, () => { | ||
return this._write(file, {}) | ||
}).then((json = {}) => { | ||
if (this.isComponentTesting(options) && 'component' in json) { | ||
json = { ...json, ...json.component } | ||
delete json.component | ||
} | ||
|
||
if (!this.isComponentTesting(options) && 'e2e' in json) { | ||
json = { ...json, ...json.e2e } | ||
delete json.e2e | ||
} | ||
|
||
const changed = this._applyRewriteRules(json) | ||
|
||
// if our object is unchanged | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good way to test that
mode
is passed correctly. We expect this project to be only used with runner-ct.