-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
refactor: move console logging out of run.ts #23555
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ 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 |
return `${color(name, colour)}` | ||
} | ||
|
||
function formatNodeVersion ({ resolvedNodeVersion, resolvedNodePath }: Pick<Cfg, 'resolvedNodeVersion' | 'resolvedNodePath'>, width) { |
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.
Can we split out / add the appropriate unit tests for this? The snapshots exist but are more a side-effect of other aspects vs explicitly testing these.
Also is it possible to fully type this new file verse adding partial types?
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 goal of this PR is to just split out some LoC from run.ts
to make it easier to work in.
All of the modes/run.js
unit tests were removed during unification, so there is not currently any unit-level testing for this logic. There's a ton of logic in here that would be helpful to have unit tests for, but since we already have coverage for this in the form of system-test snapshots, I don't feel it's particularly important to add in this PR, since it has survived without unit tests for this long.
I added more types to make this area easier to work in: e0aeb06 I started trying to type the results
object, but it turned into a rabbithole, it's overloaded with 3 separate result types (Mocha end, early exit, and dashboard skip), properly typing it would require either a refactor or a lot of falsy checks.
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.
👍 👍
User facing changelog
Additional details
run.ts
easier to work on by factoring out all of the complicated display logic. Nowrun.ts
is a measly ~1100 lines long, down from ~1700!Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?