-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test(react): add snapshot test for public API #5495
test(react): add snapshot test for public API #5495
Conversation
Deploy preview for carbon-elements ready! Built with commit da6e180 |
Deploy preview for carbon-components-react ready! Built with commit da6e180 https://deploy-preview-5495--carbon-components-react.netlify.com |
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 looks good to me! Out of curiosity, would this slow anything down? Like our build time or something?
@abbeyhrt nope! Should only be an extra 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.
I'm all for it 👍 Changes made to PropTypes
should be intentional, and this is a nice way to catch any unintended changes
) * test(react): add snapshot test for public API * Update packages/react/__tests__/PublicAPI-test.js * chore(project): update CODEOWNERS to include release team * chore(react): update snapshot * Update CODEOWNERS Co-authored-by: TJ Egan <[email protected]>
Adds in a test that snapshots our public API for
carbon-components-react
. In particular, this test uses oursrc/index.js
entrypoint to determine which components we export and defines their public API through a combination of the components'propTypes
and other properties available. To get prop type information, we mock theprop-types
package to return the type information.Changelog
New
PublicAPI-test.js
file that determines the public API of our components and creates a snapshot of these valuesChanged
Removed
Testing / Reviewing