Slack engineers achieve 80% automated migration of 15,500 Enzyme tests to React Testing Library using a hybrid AST and LLM pipeline
Slack had 15,500 Enzyme tests requiring migration to React Testing Library to support a React 18 upgrade, with an estimated total of more than 10,000 engineering hours if done manually and no existing open-source tools or adapters to help automate the work.
How it works
Common implementation structure
How this type of workflow is generally built, generalized across documented cases — not tied to any one vendor's stack. Click any stage to read what happens there. Specific products that implement these stages appear in “Tools commonly seen” below.
Stage 1 · File submitted to pipeline
A test file is submitted as input to the end-to-end conversion pipeline.
Tools used
Claude 2.1ASTcodemodnpm
Outcome
The hybrid AST and LLM pipeline converted 80% of code in each file correctly and saved 22% of developer time, enabling the team to complete all 15,500 test migrations by May 2024. The tool was open-sourced on npm for other companies to use.
What failed first
A pure AST codemod approach achieved only a 45% success rate due to the complexity of Enzyme's 65 methods and JavaScript/TypeScript variability. An initial Claude 2.1 LLM-only trial achieved just 40% to 60% success with high variability and was not released to developers.