
React18 Enzyme To Rtl
github/awesome-copilotOfficial
Migrates Enzyme tests to React Testing Library with behavior-focused rewrites for React 18 upgrades.
- skills.sh installs
- 743
- GitHub stars
- 41.4K
- last updated
- Aug 21, 2026
What it does
- Covers the Enzyme-to-RTL API mapping for shallow, mount, find, simulate, prop, state, and instance calls
- Includes reference files for the full API map and async patterns such as waitFor, findBy, act(), and Apollo MockedProvider
- Enforces a query priority order, favoring getByRole over getByTestId, and asserting visible output rather than internal state
- Designed for teams upgrading to React 18 that must rewrite Enzyme test files without a 1:1 translation
Install
$ npx -y skills add github/awesome-copilot --skill react18-enzyme-to-rtl -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
React 18 Enzyme → RTL Migration
Enzyme has no React 18 adapter and no React 18 support path. All Enzyme tests must be rewritten using React Testing Library.
The Philosophy Shift (Read This First)
Enzyme tests implementation. RTL tests behavior.
// Enzyme: tests that the component has the right internal state
expect(wrapper.state('count')).toBe(3);
expect(wrapper.instance().handleClick).toBeDefined();
expect(wrapper.find('Button').prop('disabled')).toBe(true);
// RTL: tests what the user actually sees and can do
expect(screen.getByText('Count: 3')).toBeInTheDocument();
expect(screen.getByRole('button', { name: /submit/i })).toBeDisabled();
This is not a 1:1 translation. Enzyme tests that verify internal state or instance methods don't have RTL equivalents - because RTL intentionally doesn't expose internals. Rewrite the test to assert the visible outcome instead.
API Map
Details
- Repository
- github.com/github/awesome-copilot
- Categories
- Testing & QA, Frontend & UI Code
- First seen
- May 16, 2026
More from github/awesome-copilot
All 293- Linkedin Post Formatter362
- Ui Screenshots216
- Data Breach Blast Radius110
- Sql Server Table Reconciliation106
- Aws Cloudwatch Investigation
- Aws Cost Optimize
- Aws Resource Health Diagnose
- Aws Well Architected Review
- Azure Well Architected Review
- Bug Reproduction Brief
- Incident Postmortem
- Mcp Implementation Security Review
- Pester Migration
- Tm7 Threat Model
- Git Commit48.7K
- Excalidraw Diagram Generator34.6K
- Multi Stage Dockerfile31.7K
- Documentation Writer28.6K
- Prd24.6K
- Refactor22.7K
- Java Springboot22.1K
- Create Readme19.6K
- Playwright Generate Test18.3K
- Github Issues17.8K
Similar to React18 Enzyme To Rtl
More Testing & QA
react19-test-patternsgithub/awesome-copilot1.3K installsMigration patterns for React 19 test files, covering act() imports, Simulate-to-fireEvent swaps, and StrictMode call counts.
javascript-typescript-jestgithub/awesome-copilot14.6K installsBest practices for Jest tests in JavaScript and TypeScript covering structure, mocking, async code, and React.
jest-react-testingmanutej/luxor-claude-marketplace1.2K installsComprehensive Jest and React Testing Library guidance for configuration, mocking, async, and hook tests.
react-native-testingcallstack/react-native-testing-library5.6K installsGuide for writing React Native component tests with Testing Library v13 and v14, covering queries, matchers, and async patterns.
migrate-to-rstestrstackjs/agent-skills433 installsStep-by-step migration workflow that moves Jest, Vitest, or Playwright Test suites to Rstest with parity checks.