-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
fix: make dev-server error message appear only once when CT is not configured #17090
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@@ -965,6 +965,14 @@ const getMsgByType = function (type, arg1 = {}, arg2, arg3) { | |||
|
|||
${chalk.yellow(arg2)} | |||
` | |||
case 'CT_NO_DEV_START_EVENT': | |||
return stripIndent`\ |
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.
nit: Can we not include the \
in the message:
To run component-testing, cypress needs the \`dev-server:start\` event.
The \
look a bit weird.
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.
The backslash are not in the command message. They are only necessary for the backticks to be displayed in the final error.
My description was confusing.
(I did a poor Copy-Paste)
@@ -32,8 +33,7 @@ const API = { | |||
|
|||
start ({ specs, config }) { | |||
if (!plugins.has('dev-server:start')) { | |||
// TODO: add link to the documentation in the error message | |||
throw new Error('It is required to register dev-server plugin that implements `dev-server:start` event for component testing.') | |||
return errors.throw('CT_NO_DEV_START_EVENT', config.pluginsFile) |
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.
Is the second arg (config.pluginsFile
) needed? Seems it is not used.
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.
Good catch, my plan was to use it in the error to offer a clickable target for the user.
Here is the path to your pluginsFile: /Users/dev/path
f686c60
to
f006452
Compare
* develop: fix: prevent saved state errors for deprecated keys (#17093) fix(studio): restore intro modal styles (#17118) refactor: add @packages/resolve-dist to isolate client/server code (#17109) fix: plugin file referenced by cypress config in angular schematics (#17143) refactor: @packages/runner-shared should also be devDependencies (#17133) chore: release @cypress/schematic-v1.4.1 fix: plugin file in angular schematics (#17141) chore(runner): render spec list inline (behind feature flag) (#17069) refactor: remove junk test (#17125) chore(server): collapse project-ct and project-e2e into project-base (#17115) fix: make dev-server error message appear only once when CT is not configured (#17090) chore: release @cypress/schematic-v1.4.0 feat: add ng generate to @cypress/schematic to generate e2e spec files (#16962) feat(studio): add ability to copy commands to clipboard (#16912) chore: release @cypress/webpack-preprocessor-v5.9.1 chore: release @cypress/webpack-batteries-included-preprocessor-v2.2.2 chore: release @cypress/vue-v3.0.0-beta.3
User facing changelog
Simplified the error when the event
dev-server:start
is not configured and users start the component testingHow has the user experience changed?
Before:
After: