-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Core/React: Add testing utilities #17282
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 528e0fc. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
c38eb2a
to
dc1f310
Compare
Hey @tmeasday @shilman @ndelangen I believe I have
working correctly and with correct types, so the PR is ready for review! I’ll likely need to do some cleanup or move files depending on what you think is sensible, so I'm looking forward for your feedback! |
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.
Great stuff! A bunch of qns/comments
ef7731b
to
10bccb4
Compare
@tmeasday @shilman @ndelangen I updated this PR by moving |
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.
Looking great @yannbf !! Just missing a deprecation warning for setGlobalConfig
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.
OK, LGTM again.
lib/builder-webpack4/templates/virtualModuleModernEntry.js.handlebars
Outdated
Show resolved
Hide resolved
…dlebars Co-authored-by: Tom Coleman <tom@chromatic.com>
…ect-annotations Replace setGlobalConfig with setProjectAnnotations
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!
Merging this. We're working on the CI errors in parallel. |
This has broken the vite builder, how would you suggest we handle it? storybookjs/builder-vite#304 |
Damn @IanVS, sorry about that! I'll make sure to add an E2E case for the vite builder. Two possible fixes: import composeConfigs from store in preview-web and reexport it, or update vite builder to use composeStories from storybook store. Let me know and I'd be happy to help tomorrow (I'm heading to bed) |
The problem with that is that the builder supports many versions of storybook, and moving the import would break with older versions of storybook, right? I think it would be best not to remove exports of storybook packages except for in major version releases, right? So, re-exporting might be the best option for now, if you wouldn't mind. Edit: just to close the loop, a fix has now been made in #17861. |
Issue:
What I did
Moved common logic from @storybook/testing-* to @storybook/store
Implemented framework-specific logic from @storybook/testing-react in @storybook/react
This will help with portable stories so they can be reused in multiple scenarios such as in jest, documentation, etc.
How to test
If your answer is yes to any of these, please make sure to include it in your PR.