-
Notifications
You must be signed in to change notification settings - Fork 7
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
Enzyme vs React Testing Library #3
Comments
I also found this tool called Spearmint: a tool to create RTL tests from UI, I tested it but I am not sure it is good enough: |
One more thing I encountered: RTL unlike Enzyme, waits and retries to get element until it is available therefor we can test async componentDidMount in other ways like loader appears and disappears and so on (many other ways available). Another thing is like @einatnielsen mentioned, enzyme uses enzyme-adapter that also creates some extra configuration and from time to time - updates. |
SummaryCC: @lidoravitan @einatnielsen @liadShiranNielsen @thehulke @amitNielsen @MatanBorenkraoutNielsen Issues:
With RTL:
With Enzyme:
With RTL:
With Enzyme:
or just as seen in our Enzyme tests now:
Waiting doesn't ensure us that what we wanted will happen, it's a matter of luck and our computer's CPU. In RTL we can just:
@lidoravitan @einatnielsen - I didn't sum things up while in the meeting so if I missed something please let me know and I'll add it. |
@einatnielsen @MatanBorenkraoutNielsen what are the cons of using RTL? what are the risks of switching from enzyme? (@talJoffeExelate ) |
At the moment we couldn't find the cons, as @thehulke mentioned, it looks like Enzyme was a step along the way and RTL actually expands its abilities and makes writing tests simpler and easier. |
@lidoravitan @einatnielsen |
CRA(Create React App) version 3.3.0 added built in support for React-Testing-Library: |
The purpose of this issue is to review the pros and cons between Enzyme and React Testing Library.
RTL Pros:
Enzyme Cons:
The text was updated successfully, but these errors were encountered: