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
My approach is usually to not test presentational components. Even at Facebook they don't do as much, as Dan said on this Q&A:
Personally I don't find unit testing components very valuable. Especially if they just contain markup — you're basically testing that React works, and we have tests in React itself for that. I think some combination of integration tests for higher-level UI scenarios (click a button, something shows up) and unit tests for logic (e.g. complex calculations) is helpful. I'm more skeptical of asserting on component output although I understand others might not agree.
If this is about components, I’ll reiterate we don’t do that much unit testing of components at Facebook.
I particularly didn't have problems on testing render props with Enzyme. They currently don't support the new Context API though (the PR was merged, but not yet released).
How can you test a component that uses a Constate
Container
?I've found some issues testing child-as-function with Enzyme. Do you have any strategy for it?
The text was updated successfully, but these errors were encountered: