How Airbnb used LLMs to migrate its React tests in six weeks
Airbnb built an in-house pipeline in which large language models rewrite old Enzyme component tests for React Testing Library, file by file, until the tests, the linter and the compiler pass.
AirbnbUnited StatesHotels and travelIn production since 2024Who built it Built in-houseHuman oversight People review exceptionsKind of solution Software engineering assistantScale nearly 3,500 React component test filesScenario Large-scale code migrationBusiness function Software engineeringOrganization EnterpriseAI types Generative AI
- Who built it
- Built in-house
- Human oversight
- People review exceptions
- Kind of solution
- Software engineering assistant
- Scale
- nearly 3,500 React component test files
- Scenario
- Large-scale code migration
- Business function
- Software engineering
- Organization
- Enterprise
- AI types
- Generative AI
tl;drAirbnb migrated nearly 3,500 React test files in 6 weeks instead of an estimated 1.5 years.See the results
Airbnb uses large language models (LLMs) in an in-house pipeline to rewrite its React component tests from the Enzyme framework to React Testing Library (RTL)1.
The pipeline moves each test file through refactor and validation steps and calls the LLM whenever a check fails1. It was Airbnb’s first large-scale, LLM-driven code migration1.
In March 2025, Airbnb reported the result of this AI code migration: nearly 3,500 test files moved to RTL in 6 weeks, against an estimate of 1.5 years of engineering time by hand1, 2, 3.
Before the deployment
Airbnb had used Enzyme for React component tests since 2015, and in 2020 the company made RTL the framework for all new React component tests1. Enzyme was designed for earlier versions of React, and its deep access to component internals no longer fit modern React testing practice1.
- No direct swap: The two frameworks differ so much that one couldn’t simply replace the other1.
- No deletion: Analysis showed that deleting the Enzyme files would leave significant gaps in code coverage1.
- Intent to keep: Each rewritten test had to keep the intent of the original test and its code coverage1.
In mid-2023, an Airbnb hackathon team showed that LLMs could convert hundreds of Enzyme files to RTL in a few days1.
What was built
In 2024, Airbnb built a pipeline that splits the migration into per-file steps that run in parallel, with configurable retry loops and prompts expanded with context from the codebase1. The model, the pipeline, its checks and the engineers divide the work:
- LLM: Rewrites each Enzyme test for RTL, then fixes the file whenever a later check fails1.
- Pipeline: Treats each file as a state machine and moves it to the next state only when the previous step’s validation passes. It runs hundreds of files at once1.
- Checks: Jest runs the migrated tests, then ESLint lints the file, and the TypeScript compiler checks it last1, 2.
- Engineers: Tune prompts and scripts for the files that keep failing, and fix by hand the files that automation can’t finish1.
“we found the most effective route to improve outcomes was simply brute force: retry steps multiple times until they passed or we reached a limit.”
Rollout
Airbnb built the 2024 pipeline on the hackathon result, to run the LLM-driven migration at scale1.
Technology and architecture
| Layer | What they used | Role | Source |
|---|---|---|---|
| Language model | Frontier models | Rewrites each Enzyme test for RTL and fixes the file when a check fails | 1 |
| Workflow engine | llm-bulk-migration | Moves each file through refactor and validation steps as a state machine | 1 |
| Workflow engine | Loop runner | Retries each step up to a configurable number of attempts | 1 |
| Prompt and context management | Dynamic prompts | Build each retry prompt from the file, its errors and related files | 1 |
| Guardrails | Jest | Runs the migrated tests and returns failures to the LLM | 1, 2 |
| Guardrails | ESLint | Lints each migrated file as a validation step | 1, 2 |
| Guardrails | TypeScript compiler | Checks each migrated file for type errors as the last step | 1, 2 |
| Monitoring | Migration status comment | Records the state of each step in the file for tracking | 1 |
| Framework or library | React Testing Library | Target test framework for every migrated file | 1 |
By the end of the migration, prompts held between 40,000 and 100,000 tokens and pulled in as many as 50 related files1. With that context, the LLM could follow team-specific patterns, common testing approaches and the architecture of the codebase1.
Data inputs
- Test file: The Enzyme test file being migrated1.
- Component source: The source code of the component under test and of its nearest imports1.
- Related tests: Tests from the same directory, which carry team-specific patterns, and passing RTL tests from the same project1.
- Validation failures: The errors from the failed step, sent with the latest version of the file on each retry1.
- Guidelines and examples: General migration guidelines, common solutions and few-shot examples written by hand1.
The pipeline reads these files from Airbnb’s codebase and stamps each test file with a comment that records the status of every step1.
How one test file flows through the system
- The pipeline starts the refactor step. The LLM rewrites the Enzyme test for RTL from a prompt with the test, the component source and related files1.
- The pipeline runs the Jest step. If tests fail, the pipeline sends the errors and the latest file back to the LLM in a new prompt1.
- The loop runner repeats the step until it passes or reaches its configured number of attempts. Most simple-to-medium files passed by 10 attempts1.
- The file goes through the lint and TypeScript compiler steps in the same way1, 2.
- The status comment records each step’s state, such as the number of Jest tests that passed and failed1.
- If the file stays stuck on a step, an engineer re-runs it, or a path pattern, from that step with the llm-bulk-migration command1.
Long-tail tuning
For the files that still failed after the first bulk run, the team worked breadth first so that the hardest files didn’t stall the rest1:
- Run all remaining failing files to find the common issues the LLM gets stuck on1.
- Select a sample of 5 to 10 files that show one common issue1.
- Update the prompts and scripts to address that issue1.
- Re-run the sample of failing files to validate the fix1.
- Run all remaining files again1.
Results
| Metric | Before | After | Scope and timeframe | Reported by |
|---|---|---|---|---|
| Time to complete the migration | 1.5 years by hand (estimate) | 6 weeks | All Enzyme component test files | Airbnb, measured1 |
| Files migrated by the automated pipeline | Not disclosed | 97% | All target files, after four days of tuning | Airbnb, measured1 |
| Files migrated in the first bulk run | Not disclosed | 75% | Target files, first bulk run of four hours | Airbnb, measured1 |
- 6 weeks: The time to finish the whole migration, against an estimate of 1.5 years of engineering time to do it by hand1.
- 75%: The share of target files that passed every step in the first bulk run, which took four hours. Nearly 900 files were left failing validation1.
- 97%: The share of all files migrated by automation after four days of sample, tune and sweep runs. Engineers fixed the last files, just under 100, in another week of work1, 2.
Airbnb replaced Enzyme while keeping the original test intent and its overall code coverage1. The total cost, including LLM API usage and six weeks of engineering time, proved far more efficient than the manual estimate1. Airbnb plans to expand the approach and build more migration tools1.
Lessons learned
Retrying with the errors in the prompt worked better than refining prompts. The team found brute-force retries more effective than other prompt engineering strategies, and the choice of related files mattered more than perfect prompt wording1.
Automation reached a ceiling on the last files. Just under 100 files still failed after 50 to 100 retries each, so engineers fixed them by hand instead of tuning further1.
The pipeline judged success by automated checks. ZenML notes that its criteria were Jest tests, lint checks and TypeScript compilation, and it reports a reader’s question on how the team confirmed that test intent stayed the same3.
The task had traits that suited LLM automation. ZenML points to the well-defined source and target formats and the clear pass criteria, and it says that other code migrations might not suit the approach as well3.
The figures are Airbnb’s own, from its engineering blog, and InfoQ, ZenML and The Pragmatic Engineer repeat them1, 2, 3, 4. The 1.5-year baseline is an estimate of manual work, not a measured duration1.
In August 2026, The Pragmatic Engineer set Airbnb’s migration beside Asana’s own Enzyme migration4. It argued that the exact size of such estimates matters less than the fact that the work would be impractical by hand, and that these migrations needed engineers to plan them, design verification loops and stay involved4.
Case study scorecard
- 6 weeks Time to complete the migration1
- 97% Files migrated by the automated pipeline1
- 75% Files migrated in the first bulk run1
Sources by publication date
- Organization 1
- Press, academic, and regulators 3
Build this solution yourself
Analysis
What you need
- Checks that define done: The pipeline advanced a file only when Jest, ESLint and the TypeScript compiler passed, and it fed their errors back to the LLM1. You need tests, a linter or a compiler that can judge each migrated file without a person.
- Good examples of the target in your codebase: Airbnb had written new tests in RTL since 2020, so prompts could pull in passing RTL tests from the same project1. Check that your codebase already holds such examples.
- Engineers for the long tail: The last 3% of files needed tuning and manual fixes1. Plan time for people to study failures and finish the files that the LLM can’t.
Reference architecture
Software engineering assistant
A software engineering assistant writes, reviews, tests, or migrates code in the tools that developers already use, and a developer approves its output. A language model writes a change, a test, or a review comment from the code for a task, and automated checks and a checker model build, test, and filter it. A reviewer approves each checked proposal in code review before it merges, and developers do the work that fails the checks by hand.
- Developer tools
- Assistant platform
- Code repository
- Code index
- Deterministic code analysis
- Standards and guidelines
- Code and platform map
- Prompts and context (documented in this case study)
- Language model (documented in this case study)
- Automated checks (documented in this case study)
- Checker model
A check mark shows a building block that this case study's sources document.
Open the reference architectureOthers who built it
- CGI: How CGI uses Codex and AI coding tools to build its own IP. AI tools lift coding productivity by up to 40% to 50% on new releases of CGI's own software.
- Mozilla: Mozilla's AI agents find 271 Firefox security bugs. Firefox 150 shipped fixes for 271 vulnerabilities that AI agents found with Claude Mythos Preview.
- LinkedIn: LinkedIn's AI coding agents migrate ML models to PyTorch. Teams estimate a model migration now takes about 2 weeks instead of about 8 weeks.
- OpenAI: How OpenAI researchers hand AI research work to Codex agents. Agents now complete an estimated 46% of two-to-four-hour research tasks without human help.
- Stripe: Stripe's unattended AI coding agents write 1,300 PRs a week. Over 1,300 merged pull requests a week at Stripe are written entirely by minions.
- Meta: LLM-generated unit tests land in production at Meta. Meta engineers accepted 73% of the test improvements TestGen-LLM offered at three test-a-thons.
Cite this case study
Enterprise AI Case Studies. "How Airbnb used LLMs to migrate its React tests in six weeks." Updated Nov 29, 2026. https://case-studies.ai/case-studies/engineering-and-research/ER-074-llm-test-migration-airbnb/
@misc{csai-er-074,
author = {{Enterprise AI Case Studies}},
title = {{How Airbnb used LLMs to migrate its React tests in six weeks}},
year = {2026},
note = {Updated 2026-11-29},
url = {https://case-studies.ai/case-studies/engineering-and-research/ER-074-llm-test-migration-airbnb/}
}Sources
The following reporting, and every passage quoted from it, belongs to its publisher, not to this site. Sources and ownership
- Source 1:
Accelerating Large-Scale Test Migration with LLMs
Supporting excerpts (53)
updating nearly 3.5K React component test files from Enzyme to use React Testing Library (RTL) instead
this would take 1.5 years of engineering time to do by hand
using a combination of frontier models and robust automation
we finished the entire migration in just 6 weeks
In 2020, Airbnb adopted React Testing Library (RTL) for all new React component test development, marking our first steps away from Enzyme.
Although Enzyme had served us well since 2015, it was designed for earlier versions of React
deep access to component internals no longer aligned with modern React testing practices
because of the fundamental differences between these frameworks
just delete the Enzyme files, as analysis showed this would create significant gaps in our code coverage
we needed an automated way to refactor test files from Enzyme to RTL while preserving the intent of the original tests and their code coverage
In mid-2023, an Airbnb hackathon team demonstrated that large language models could successfully convert hundreds of Enzyme files to RTL in just a few days.
in 2024 we developed a scalable pipeline for an LLM-driven migration
Building on this promising result
We broke the migration into discrete, per-file steps that we could parallelize, added configurable retry loops, and significantly expanded our prompts with additional context.
each file moves through stages of validation, and when a check fails, we bring in the LLM to fix it
We modeled this flow like a state machine, moving the file to the next state only after validation on the previous state passed
It enabled us to track progress, improve failure rates for specific steps, and rerun files or steps when needed.
made it simple to run migrations on hundreds of files concurrently
we found the most effective route to improve outcomes was simply brute force: retry steps multiple times until they passed or we reached a limit.
We updated our steps to use dynamic prompts for each retry, giving the validation errors and the most recent version of the file to the LLM, and built a loop runner that ran each step up to a configurable number of attempts.
with some finishing successfully after a few retries, and most by 10 attempts
to handle files with intricate test state setups or excessive indirection, we found the best approach was to push as much relevant context as possible into our prompts
our prompts had expanded to anywhere between 40,000 to 100,000 tokens, pulling in as many as 50 related files, a whole host of manually written few-shot examples, as well as examples of existing, well-written, passing test files from within the same project
The source code of the component under test
The test file we were migrating
Validation failures for the step
Related tests from the same directory (maintaining team-specific patterns)
General migration guidelines and common solutions
`IMPORTS:\n${nearestImportSourceCode}`,
the LLM could better understand team-specific patterns, common testing approaches, and the overall architecture of the codebase
the main success driver we saw was choosing the right related files
rather than getting the prompt engineering perfect
we successfully migrated 75% of our target files in just four hours
it still left us with nearly 900 files failing our step-based validation criteria
We also wanted to do this breadth first to aggressively chip away at our remaining files without getting stuck on the most difficult migration cases.
stamping files with an automatically-generated comment to record the status of each migration step
"jest":{"passed":8,"failed":2,"total":10,"skipped":0,"successRate":80},"eslint":"pending","tsc":"pending"
we added the ability to easily re-run single files or path patterns, filtered by the specific step they were stuck on
$ llm-bulk-migration --step=fix-jest --match=project-abc/**
Run all remaining failing files to find common issues the LLM is getting stuck on
Select a sample of files (5 to 10) that exemplify a common issue
Update our prompts and scripts to address that issue
Re-run against the sample of failing files to validate our fix
Repeat by running against all remaining files again
loop for 4 days, we had pushed our completed files from 75% to 97% of the total files, and had just under 100 files remaining.
we had retried many of these long tail files anywhere between 50 to 100 times, and it seemed we were pushing into a ceiling of what we could fix via automation
Rather than invest in more tuning, we opted to manually fix the remaining files, working from the baseline (failing) refactors to reduce the time to get those files over the finish line.
And for the remaining 3% of files
allowing us to complete the migration for those remaining files in another week of work
we were able to replace Enzyme while maintaining original test intent and our overall code coverage
including LLM API usage and six weeks of engineering time
proved far more efficient than our original manual migration estimate
We plan to expand this approach, develop more sophisticated migration tools, and explore new applications of LLM-powered automation to enhance developer productivity.
- Source 2:
How Airbnb Used LLMs to Accelerate Test Migration
Supporting excerpts (4)
Airbnb significantly accelerated the process of updating its codebase to adopt React Testing Library (RTL) and converted nearly 3.5K React test files originally using Enzyme
starting with refactoring Enzyme to RTL, then fixing any errors found in Jest tests, running the linter, and finally, the TypeScript compiler
Airbnb staff software engineer Charles Covey-Brandt
The remaining files, less than 100, were fixed manually.
- Source 3:
AirBnB: Large-Scale Test Framework Migration Using LLMs
Supporting excerpts (5)
successfully converting nearly 3,500 React component test files from the Enzyme testing framework to React Testing Library (RTL)
The primary validation criteria appear to be automated checks (Jest tests passing, lint checks, TypeScript compilation).
One reader comment raised an important question about whether test success was the only criterion and how the team validated that test intent remained the same.
This migration was particularly well-suited for LLM automation because it involved a well-defined source and target format, with clear validation criteria (tests passing).
Not all code migrations may be as amenable to this approach.
- Source 4:
The Pulse: We need to talk about migrations with AI
Supporting excerpts (6)
Last year, Airbnb revealed how they migrated their Enzyme test suite of 3,500 component test files within six weeks with LLMs.
The estimate of doing this by hand was 1.5 engineering years.
does it matter if the estimate was 1.5 years (Airbnb) or half a decade (Asana, hypothetically)?
It would still be an impractical migration and a foolish endeavor
I find it credible that it took Asana two weeks to migrate what is probably a similarly complex test infrastructure from Enzyme to RTL, a year later.
The shared characteristic of all of the above migrations is that engineers needed to plan for it, design verification loops, and be involved throughout.
Comments
Start the conversation.
Invited members of the library comment here. Sign in to join the conversation.