Agent skill · software engineering · github
react19-test-patterns
Provides before/after patterns for migrating test files to React 19 compatibility, including act() imports, Simulate removal, and StrictMode call count changes.
Why this skill is useful
Provides specific migration patterns and code examples for updating test files to be compatible with React 19, which the AI wouldn't reliably generate on its own.
What it needs
About 2k tokens when loaded. Last updated 2026-08-07. 37,534 stars on the source repository.
What this skill does
React 19 Test Migration Patterns Reference for all test file migrations required by React 19. Priority Order Fix test files in this order; each layer depends on the previous: 1. act import fix first, it unblocks everything else 2. Simulate → fireEvent fix immediately after act 3. Full react-dom/test-utils cleanup remove remaining imports 4. StrictMode call counts measure actual, don't guess 5. Async act wrapping for remaining "not wrapped in act" warnings 6. Custom render helper verify once per codebase, not per test --- 1. act() Import Fix If mixed with other test-utils imports: --- 2. Simulate → fireEvent --- 3. react-dom/test-utils Full API Map Old (react-dom/test-utils) New location --- --- act import { act } from 'react' Simulate fireEvent from @testing-library/react renderIntoDocument render from @testing-library/react findRenderedDOMComponentWithTag getByRole, getByTestId from RTL findRenderedDOMComponentWithClass getByRole or container.querySelector scryRenderedDOMComponentsWithTag getAllByRole from RTL isElement, isCompositeComponent Remove not needed with RTL isDOMComponent Remove --- 4. StrictMode Call Count Fixes React 19 StrictMode no longer double-invokes useEffect in development. Spy assertions counting effect calls must be updated. Strategy always measure, never guess:
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills github/react19-test-patterns