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
chore: Refactor chainer / Commands.add for readability #22571
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 |
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.
Nice! Love to see cleanup in this area. It's a 🐻
return null | ||
addSelector (name, fn) { | ||
// TODO: Add overriding stuff. | ||
return cy.addSelector(name, fn) |
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.
Ah, whoops, slight code-splatter here, had meant to remove this before committing. I'll clean it up in an upcoming refactor. Not used yet, shouldn't be in yet. Same with selectorFns
below.
User facing changelog
No user-facing changes.
Additional details
This PR is the first of hopefully several with some cleanup and refactoring of a very hard to read and central part of our code base: How commands are added, queued, and executed.
There are no functional changes. The code is logically identical - but hopefully easier to read, with less internal state tracking and passing around of variables "to be used at some later point."
Steps to test
All cypress tests execute identically. The CI build passing without test changes should show this well enough, but feel free to manually play with it as well.
How has the user experience changed?
UX is unchanged. DX, reading this code, should be far better.
PR Tasks
cypress-documentation
?type definitions
?