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

fix(customPropTypes): show all errors if some() fails #473

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

levithomason
Copy link
Member

@levithomason levithomason commented Sep 7, 2016

The some() validator requires at least one prop type validator to pass. Currently, if they all fail we show only the first validator error message.

This is not helpful as the first error may not be applicable to the usage, perhaps it is the 3rd error that should be resolved for a particular usage. This PR updates the error message to include all errors messages so the user can correct at least one. Resulting in some() validator passing:

Warning: Failed prop type: One of these validators must pass:
[1]: Invalid prop `labeled` of type `string` supplied to `Button`, expected `boolean`.
[2]: Invalid prop `labeled` of value `icon` supplied to `Button`, expected one of ["left icon","right icon"].
    in Button (created by ButtonLabeledIconExample)
    ...

@codecov-io
Copy link

Current coverage is 98.61% (diff: 100%)

Merging #473 into master will not change coverage

@@             master       #473   diff @@
==========================================
  Files           101        101          
  Lines          1444       1444          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1424       1424          
  Misses           20         20          
  Partials          0          0          

Powered by Codecov. Last update e9dc443...4be9ff3

@levithomason levithomason merged commit 1387a5a into master Sep 7, 2016
@levithomason levithomason deleted the fix/custom-proptypes-some branch September 7, 2016 18:00
@levithomason
Copy link
Member Author

Released in stardust@0.42.1

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 this pull request may close these issues.

2 participants