Skip to content
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

Document Component Testing changes in 8.5 #29794

Closed
Tracked by #29531
JReinhold opened this issue Dec 3, 2024 · 1 comment · Fixed by #30035
Closed
Tracked by #29531

Document Component Testing changes in 8.5 #29794

JReinhold opened this issue Dec 3, 2024 · 1 comment · Fixed by #30035
Assignees

Comments

@JReinhold
Copy link
Contributor

JReinhold commented Dec 3, 2024

Focused Tests

We can expand the section in https://storybook.js.org/docs/writing-tests/test-addon#storybook-ui
No code snippets necessary, it's all explainable with prose+video/images, similar to the existing content in that section.

Focused tests work on the story, component and group level.

Coverage is not enabled in focused tests. You can run a focused test while having watch mode enabled simultanously.

Coverage

  • Coverage only accounts for stories, not any other Vitest tests configured. Using Vitest CLI instead includes the full coverage of the whole Vitest test suite, including stories.
  • We report Statements as the overall project coverage metric
  • We respect test.coverage.watermarks as a config for the pie chart color
  • You need the Vitest dependencies
  • Coverage and watch-mode are mutually exclusive. If coverage is enabled, enabling watch mode disables coverage.
  • HTML report is available at localhost:6006/coverage/index.html.
  • We respect most of the the user's settings at test.coverage (providers, etc), except for:
            enabled: true,
            clean: false,
            cleanOnRerun: !watchMode,
            reportOnFailure: true,
            reporter: [['html', {}], storybookCoverageReporter],
            reportsDirectory: resolvePathInStorybookCache(COVERAGE_DIRECTORY),

Misc

Configuration in UI

@JReinhold
Copy link
Contributor Author

Also #29613

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants