mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-21 22:50:49 -06:00
revise SETUP_NODE_EVENTS_IS_NOT_FUNCTION error
This commit is contained in:
@@ -34,12 +34,16 @@
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/cypress.config.js<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The setupNodeEvents in your <span style="color:#e5e510">e2e<span style="color:#e05561"> config should define a function with the following signature:<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The <span style="color:#de73ff">component.setupNodeEvents()<span style="color:#e05561"> function must be defined with the following signature:<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff">setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks / plugins here<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:#4ec4ff"> component: {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks and plugins here<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:#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">Instead we saw:<span style="color:#e6e6e6">
|
||||
@@ -50,5 +54,5 @@
|
||||
<span style="color:#e05561"><span style="color:#de73ff">]<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">https://on.cypress.io/plugins-api<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><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"><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></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
|
||||
</pre></body></html>
|
||||
@@ -34,12 +34,16 @@
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/cypress.config.js<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The setupNodeEvents in your <span style="color:#e5e510">e2e<span style="color:#e05561"> config should define a function with the following signature:<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The <span style="color:#de73ff">component.setupNodeEvents()<span style="color:#e05561"> function must be defined with the following signature:<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff">setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks / plugins here<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:#4ec4ff"> component: {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks and plugins here<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:#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">Instead we saw:<span style="color:#e6e6e6">
|
||||
@@ -47,5 +51,5 @@
|
||||
<span style="color:#e05561"><span style="color:#de73ff">"some string"<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">https://on.cypress.io/plugins-api<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><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 style="color:#e05561"><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></span></span></span>
|
||||
</pre></body></html>
|
||||
@@ -34,12 +34,16 @@
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/pluginsFile<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<body><pre><span style="color:#e05561">Your <span style="color:#e5e510">configFile<span style="color:#e05561"> is invalid: <span style="color:#4ec4ff">/path/to/cypress.config.js<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The setupNodeEvents in your <span style="color:#e5e510">e2e<span style="color:#e05561"> config should define a function with the following signature:<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">The <span style="color:#de73ff">e2e.setupNodeEvents()<span style="color:#e05561"> function must be defined with the following signature:<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff">setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks / plugins here<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:#4ec4ff"> e2e: {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> setupNodeEvents(on, config) {<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#4ec4ff"> <span style="color:#4f5666">// configure tasks and plugins here<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:#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">Instead we saw:<span style="color:#e6e6e6">
|
||||
@@ -49,5 +53,5 @@
|
||||
<span style="color:#e05561"><span style="color:#de73ff">}<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><span style="color:#e6e6e6">
|
||||
<span style="color:#e05561">https://on.cypress.io/plugins-api<span style="color:#e6e6e6">
|
||||
<span style="color:#e05561"><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 style="color:#e05561"><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></span></span></span></span></span></span></span></span></span></span></span>
|
||||
</pre></body></html>
|
||||
@@ -604,14 +604,18 @@ export const AllCypressErrors = {
|
||||
// TODO: make this relative path, not absolute
|
||||
SETUP_NODE_EVENTS_IS_NOT_FUNCTION: (configFilePath: string, testingType: string, exported: any) => {
|
||||
const code = errPartial`
|
||||
setupNodeEvents(on, config) {
|
||||
${fmt.comment(`// configure tasks / plugins here`)}
|
||||
{
|
||||
${fmt.off(testingType)}: {
|
||||
setupNodeEvents(on, config) {
|
||||
${fmt.comment(`// configure tasks and plugins here`)}
|
||||
}
|
||||
}
|
||||
}`
|
||||
|
||||
return errTemplate`\
|
||||
Your ${fmt.highlight(`configFile`)} is invalid: ${fmt.path(configFilePath)}
|
||||
|
||||
The setupNodeEvents in your ${fmt.highlight(testingType)} config should define a function with the following signature:
|
||||
The ${fmt.highlightSecondary(`${testingType}.setupNodeEvents()`)} function must be defined with the following signature:
|
||||
|
||||
${fmt.code(code)}
|
||||
|
||||
|
||||
@@ -658,9 +658,9 @@ describe('visual error templates', () => {
|
||||
},
|
||||
SETUP_NODE_EVENTS_IS_NOT_FUNCTION: () => {
|
||||
return {
|
||||
default: ['/path/to/pluginsFile', 'e2e', { some: 'object' }],
|
||||
string: ['/path/to/pluginsFile', 'e2e', 'some string'],
|
||||
array: ['/path/to/pluginsFile', 'e2e', ['some', 'array']],
|
||||
default: ['/path/to/cypress.config.js', 'e2e', { some: 'object' }],
|
||||
string: ['/path/to/cypress.config.js', 'component', 'some string'],
|
||||
array: ['/path/to/cypress.config.js', 'component', ['some', 'array']],
|
||||
}
|
||||
},
|
||||
CONFIG_FILE_SETUP_NODE_EVENTS_ERROR: () => {
|
||||
|
||||
Reference in New Issue
Block a user