You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey @ONE-BIG-MOB1, if you're running checkPropTypes in tests, be aware that you can get false negatives, since prop-types won't log any error it has already seen.
Here is a bit of discussion, an open PR with one solution, and a hopefully helpful package (I'm the author) made specifically for testing with prop-types.
@uniphil this is a very helpful comment. I was indeed stubbing console.error to check for prop-types errors. I will definitely give your package a try instead. Cheers!
If I have a stateless functional component such as this:
If I test it like this:
The test passes.
However, if instead I test the SlideView like this:
No prop-types error is logged to the console, so the test fails.
I didn't expect this behaviour. I think it would be useful if the props were validated in this case.
The text was updated successfully, but these errors were encountered: