-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
A CLI for running specific tests suites, like bootstrap CLI #1752
Conversation
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 tested both cra and react-native. Looks good, really appreciate this!
Can we perhaps have an option to run it with the -u
to update snapshots?
Codecov Report
@@ Coverage Diff @@
## release/3.3 #1752 +/- ##
============================================
Coverage 23.12% 23.12%
============================================
Files 253 253
Lines 5756 5756
Branches 686 689 +3
============================================
Hits 1331 1331
+ Misses 3920 3916 -4
- Partials 505 509 +4
Continue to review full report at Codecov.
|
…to jest Could be expanded later to run a lots of test, and allows us to pick what tests we want to run via command line flags or a GUI.
f6ca7dc
to
b64af7b
Compare
```sh | ||
git clone https://github.com/storybooks/storybook.git | ||
cd storybook | ||
yarn install |
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 think @Hypnosphi opted to use the shorthand yarn
notation. We should keep it consistent
.circleci/config.yml
Outdated
@@ -147,8 +147,8 @@ jobs: | |||
- run: | |||
name: "Unit testing" | |||
command: | | |||
yarn test -- --coverage -i | |||
yarn coverage | |||
npm run test -- --all --coverage --runInBand |
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.
If yarn works on circleci, I think we should keep it consistent there as well.
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.
Same concerns as @danielduan's, otherwise LGTM
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.
Works fine!
Maybe it worth to add an option for testing a certain package? And do same for test coverage option
@Hypnosphi should be fixed! |
And |
I like the explicitness of I don't see a reason to make use of the shorthand when not typing by hand. |
Change it to this everywhere then =) Let's be consistent with it |
Issue: #1734
What I did
I improved the 'running-tests'-experience by creating a inquirer script for running the test-suites.
How to test
yarn test
>> should open an inquireryarn test -- --watch
>> should start default suites in watchmodeyarn test -- --core --watch
>> should start only core suite in watchmodeyarn test -- --core --reactnative
>> should start core & reactnative suites to completionIt's also possible to run
yarn test -- -h
to get a list of all options available.Why
I like this because it makes it discoverable. It also allows contributors to focus on a subset of tests. This is useful in our codebase because changes to for example the
react
,vue
orangular
apps can not have any effect on their tests. So if your changes are solely on those parts of the codebase it makes little sense to have to bootstrap the react-native example(s) just to be able to run the unit tests.I've set ALL the suites as
default = true
, so that includes the react-native suite! So it's an OPT-OUT to NOT run the tests for react-native. Feedback on this would be appreciated very much!TODO
Is this testable with jest or storyshots?
Possibly, I'm hoping the reviewers will let me know if they think that would be sensible
Does this need an update to the documentation?
YES, I'll do that after I hear positive reactions on the feature itself
Merging this would fix: #1734