-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add support for test filtering via tags #382
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## next #382 +/- ##
==========================================
+ Coverage 76.66% 80.64% +3.97%
==========================================
Files 11 12 +1
Lines 180 217 +37
Branches 40 56 +16
==========================================
+ Hits 138 175 +37
Misses 42 42 ☔ View full report in Codecov by Sentry. |
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.
Looks great! Minor comment on the code. Also, you might want to provide a recipe for how to only execute tests with a play function using tags, since that's a frequently requested feature.
cceb639
to
449be19
Compare
🚀 PR was released in |
Closes: #281, Closes: #218, Closes: #74, Closes: #306, Closes: #247
This PR introduces the concept of test filtering via the story tags annotation.
Filtering tests (experimental)
You might want to skip certain stories in the test-runner, run tests only against a subset of stories, or exclude certain stories entirely from your tests. This is possible via the
tags
annotation.This annotation can be part of a story, therefore only applying to it, or the component meta (the default export), which applies to all stories in the file:
Once your stories have your own custom tags, you can filter them via the tags property in your test-runner configuration file. You can also use the CLI flags
--includeTags
,--excludeTags
or--skipTags
for the same purpose. The CLI flags will take precedence over the tags in the test-runner config, therefore overriding them.Test-runner config: tags
The
tags
property contains three options:include | exclude | skip
, each accepting an array of strings:📦 Published PR as canary version:
0.15.0--canary.382.449be19.0
✨ Test out this PR locally via:
Version
Published prerelease version:
v0.15.0-next.0
Changelog
🚀 Enhancement
🐛 Bug Fix
checkStorybook
to useGET
method #385 (@stramel)Authors: 4