-
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
feat(component-testing): Expose CT through CLI module API #16368
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.
One comment, mostly stylistic - the actual functionality looks good.
Maybe we can change one of the examples in npm/react
to launch via the module api as a test?
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 is great, one minor comment. How do I manually test the module API?
My testing was done with: /* @ts-ignore */
import cypress from '../../cli/lib/cypress'
const run = cypress.run as (options?: Partial<CypressCommandLine.CypressRunOptions>) => Promise<CypressCommandLine.CypressRunResult | CypressCommandLine.CypressFailedRunResult>
run({
spec: './cypress/component/advanced/framer-motion/Motion.spec.tsx',
testingType: 'component',
/* @ts-ignore */
dev: true,
}).then(results => {
console.log(results)
}) |
I kinda want this documented in the CONTRIBUTING.md, yknow? You didn't know how to test it either. |
Done. See |
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.
LGTM (we could have use the existing isComponentTesting
flag but it felt odd)
* develop: remove unused deps from webpack-preprocessor (#16384) feat: exclude html pwa plugin in webpack dev server (#16388) fix(ui): display duplicate aliases in command log (#16382) fix(ui): show req stub/fn when a handler is supplied (#16383) feat(component-testing): Expose CT through CLI module API (#16368)
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
User facing changelog
Allows launching Component Testing through the CLI module API. This provides for programmatic access to the CT runner.
Additional details
Slightly cleaned up the current CLI implementation of Component Testing. Expect further work on this front.
PR Tasks
cypress-documentation
? Add documentation fortestingType
cypress-documentation#3911type definitions
?