Open ChristopherChudzicki opened 2 years ago
Hey guys, doing deprecation of Enzyme in my project, I figured out there is a way to make this process more manageable and automated: https://thesametech.com/migrate-away-from-enzyme/
Please check out my article, and let me know what you think! I plan to work on my plugin and improve it further, for now, it's a beta version.
@sr-shifu Thanks for sharing—neat idea to use ESLint to manage the process. I hope to take a closer look soon!
We should stop using Enzyme and use React Testing Library (RTL; @testing-library/react) instead.
Why ditch Enzyme / Why React Testing Library
There are lots of articles on this. I like Time to Say Goodbye—Enzyme.js. Here's a summary
"It relies on React internal implementation, and React team discourages using it". In particular:
from Dan Abramov (redux creator; co-creator of create-react-app)
How to switch
Most of our frontend tests rely on a helper class, IntegrationTestHelper. In #1274 I wrote a new version of this (with almost identical API as the old) that uses RTL and Jest instead of Enzyme and Sinon, and re-wrote one test file as a proof of concept. So... Let's do that more.