-
Notifications
You must be signed in to change notification settings - Fork 648
Fix storybook tests for vitest 4.0.16 compatibility #7406
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
Fix storybook tests for vitest 4.0.16 compatibility #7406
Conversation
|
Refactored the storybook.test.tsx to avoid calling describe() inside describe.each() callback. Vitest 4.0.16 introduced stricter rules about when suite functions can be called. The previous pattern used a for loop inside describe.each() to dynamically create nested describe blocks, which is now rejected. Changed to use describe.each() directly with flattened stories array instead of grouping by component name and creating nested describes. Co-authored-by: francinelucca <[email protected]>
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
|
@copilot CI is still failing |
The storybook tests pass locally with vitest 4.0.16 (all 312 tests pass). Could you share the specific error message from the CI logs so I can investigate the failure? Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Vitest 4.0.16 rejects calling suite functions inside test execution contexts. The storybook test file violated this by dynamically creating
describe()blocks inside adescribe.each()callback'sforloop.Before:
After:
Changelog
Changed
storybook.test.tsxto flatten story array and avoid nesteddescribe()callslodash.groupbydependency from test fileRollout strategy
Testing & Reviewing
All 312 storybook tests pass with identical coverage. Test names now include component name, title, and filepath for easier identification.
Merge checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.