-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: scaffold and register cy.mount command for CT #20933
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
Conversation
|
Thanks for taking the time to open a PR!
|
| private ensureDir (type: 'component' | 'e2e' | 'fixtures') { | ||
| return this.ctx.fs.ensureDir(path.join(this.projectRoot, 'cypress', type)) | ||
| } | ||
|
|
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.
Moved to packages/scaffold-config, trying to consolidate all the scaffolding code in one place.
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 |
||||||||||||||||||||||||||
ZachJW34
left a comment
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.
Straightforward, works great. Moving the remaining scaffolding logic is 🔥
| declare global { | ||
| namespace Cypress { | ||
| interface Chainable { | ||
| mount(...): Cypress.Chainable<MountReturn> |
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.
This ... here isn't meant to be what we actually ship, I mostly meant it to indicate that it should be is supposed to be filled in with the appropriate mount signature dependent on the framework chosen
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.
I guess it could be as simple as
declare global {
namespace Cypress {
interface Chainable {
mount: typeof mount
}
}
} 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.
🤦♂️
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.
Done. d304fba
note: forked from #20893
note: the generated file will be invalid until https://cypress-io.atlassian.net/browse/UNIFY-1386 lands, which bundles the mount commands in the binary.
User facing changelog
Scaffold correct supportFile for component testing, including adding custom
mountcommand and type definitions, if using TypeScript.Additional details
We register a convinient
cy.mountcommand for CT when scaffolding a new project, or migrating an existing one.Example for a project using React and TypeScript:
How has the user experience changed?
Better scaffolding for CT based on your framework.
PR Tasks
cypress-documentation?type definitions?cypress.schema.json?