Add error when componentFolder found in 10.0 configs

This commit is contained in:
BlueWinds
2022-03-16 12:31:23 -07:00
parent 011d676084
commit 62b105fcb0
6 changed files with 116 additions and 2 deletions
+5
View File
@@ -4,6 +4,7 @@ import * as validate from './validation'
import pkg from '@packages/root'
export type BreakingOptionErrorKey =
| 'COMPONENT_FOLDER_DEPRICATION'
| 'CONFIG_FILE_INVALID_ROOT_CONFIG'
| 'CONFIG_FILE_INVALID_ROOT_CONFIG_E2E'
| 'CONFIG_FILE_INVALID_TESTING_TYPE_CONFIG_COMPONENT'
@@ -515,6 +516,10 @@ export const breakingOptions: Array<BreakingOption> = [
name: 'blacklistHosts',
errorKey: 'RENAMED_CONFIG_OPTION',
newName: 'blockHosts',
}, {
name: 'componentFolder',
errorKey: 'COMPONENT_FOLDER_DEPRICATION',
isWarning: false,
}, {
name: 'experimentalComponentTesting',
errorKey: 'EXPERIMENTAL_COMPONENT_TESTING_REMOVED',
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap" rel="stylesheet">
<style>
body {
font-family: "Courier Prime", Courier, monospace;
padding: 0 1em;
line-height: 1.4;
color: #eee;
background-color: #111;
}
pre {
padding: 0 0;
margin: 0 0;
font-family: "Courier Prime", Courier, monospace;
}
body {
margin: 5px;
padding: 0;
overflow: hidden;
}
pre {
white-space: pre-wrap;
word-break: break-word;
-webkit-font-smoothing: antialiased;
}
</style>
</head>
<body><pre><span style="color:#e05561">The <span style="color:#e5e510">componentFolder<span style="color:#e05561"> configuration option is now invalid when set on the config object in Cypress version 10.0.0.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"> It is now renamed to <span style="color:#e5e510">specPattern<span style="color:#e05561"> and configured separately as a component testing property: <span style="color:#de73ff">component.specPattern<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"> <span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">{<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> component: {<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> specPattern: &#39;...&#39;,<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff"> },<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"> https://on.cypress.io/migration-guide<span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap" rel="stylesheet">
<style>
body {
font-family: "Courier Prime", Courier, monospace;
padding: 0 1em;
line-height: 1.4;
color: #eee;
background-color: #111;
}
pre {
padding: 0 0;
margin: 0 0;
font-family: "Courier Prime", Courier, monospace;
}
body {
margin: 5px;
padding: 0;
overflow: hidden;
}
pre {
white-space: pre-wrap;
word-break: break-word;
-webkit-font-smoothing: antialiased;
}
</style>
</head>
<body><pre><span style="color:#e05561">We&#39;re ending the experimental phase of Cypress Studio in Cypress version 10.0.0 and have learned a lot. Stay tuned for updates on Studio&#39;s official release in the future. You can leave feedback here: http://on.cypress.io/studio-beta.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561">You can safely remove the <span style="color:#e5e510">experimentalStudio<span style="color:#e05561"> configuration option from your config.<span style="color:#e6e6e6"></span></span></span></span></span></span></span></span>
</pre></body></html>
@@ -37,7 +37,6 @@
<body><pre><span style="color:#e05561">The <span style="color:#e5e510">testFiles<span style="color:#e05561"> configuration option is now invalid when set on the config object in Cypress version 10.0.0.<span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"> It is now renamed to <span style="color:#e5e510">specPattern<span style="color:#e05561"> and configured separately as a testing type property: <span style="color:#de73ff">e2e.specPattern<span style="color:#e05561"> and <span style="color:#de73ff">component.specPattern<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"> <span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">{<span style="color:#e05561"><span style="color:#e6e6e6">
@@ -49,5 +48,5 @@
<span style="color:#e05561"><span style="color:#4ec4ff"> },<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#4ec4ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"><span style="color:#e6e6e6">
<span style="color:#e05561"> https://on.cypress.io/migration-guide<span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
<span style="color:#e05561"> https://on.cypress.io/migration-guide<span style="color:#e6e6e6"></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
</pre></body></html>
+16
View File
@@ -1377,7 +1377,23 @@ export const AllCypressErrors = {
The ${fmt.highlight(errShape.name)} configuration option is now invalid when set on the config object in ${fmt.cypressVersion(`10.0.0`)}.
It is now renamed to ${fmt.highlight('specPattern')} and configured separately as a testing type property: ${fmt.highlightSecondary('e2e.specPattern')} and ${fmt.highlightSecondary('component.specPattern')}
${fmt.code(code)}
https://on.cypress.io/migration-guide`
},
COMPONENT_FOLDER_DEPRICATION: (errShape: BreakingErrResult) => {
const code = errPartial`
{
component: {
specPattern: '...',
},
}`
return errTemplate`\
The ${fmt.highlight(errShape.name)} configuration option is now invalid when set on the config object in ${fmt.cypressVersion(`10.0.0`)}.
It is now renamed to ${fmt.highlight('specPattern')} and configured separately as a component testing property: ${fmt.highlightSecondary('component.specPattern')}
${fmt.code(code)}
https://on.cypress.io/migration-guide`
@@ -1117,5 +1117,10 @@ describe('visual error templates', () => {
default: [{ name: 'testFiles', configFile: '/path/to/cypress.config.js.ts' }],
}
},
COMPONENT_FOLDER_DEPRICATION: () => {
return {
default: [{ name: 'componentFolder', configFile: '/path/to/cypress.config.js.ts' }],
}
},
})
})