Last summer at work, I embarked on a solo project to convert over 800 of our unit tests for various React components from using Enzyme1 to React Testing Library2 as part of a larger migration to React v18, TypeScript, and moving our code into a larger monorepo at Zillow.

This process was made much easier thanks to using the power of LLMs!

Just this week, I have seen two blog posts from various dev teams detailing how they did the same thing!

How we navigated the shift from Enzyme to React Testing Library at The New York Times.

As part of our efforts to maintain and improve the functionality and performance of The New York Times core website, we recently upgraded our React library from React 16 into React 18. One of the biggest challenges we faced in the process was transforming our codebase from the Enzyme test utility into the React Testing Library.

And today, I saw this from the AirBnb Tech Blog: “Accelerating Large-Scale Test Migration with LLMs

Airbnb recently completed our first large-scale, LLM-driven code migration, updating nearly 3.5K React component test files from Enzyme to use React Testing Library (RTL) instead. We’d originally estimated this would take 1.5 years of engineering time to do by hand, but — using a combination of frontier models and robust automation — we finished the entire migration in just 6 weeks.

1 Enzyme is a JavaScript testing utility, originally developed by AirBnb, for React that allows developers to “traverse, manipulate, and simulate interactions with component trees”, but it relies on various implementation details and has become less relevant with modern React practices.

2 React Testing Library is a lightweight testing framework for React that focuses on testing components as users interact with them, emphasizing accessibility and avoiding reliance on implementation details.