
React19 Test Patterns
If you're migrating tests to React 19, this gives you the exact before/after patterns for the breaking changes. It covers the act() import move from react-dom/test-utils to react, replacing the removed Simulate API with fireEvent, and the StrictMode call count adjustments since effects no longer double-invoke in development. The priority order is smart: fix act() imports first since everything else depends on it, then work through Simulate, then tackle the call count assertions. The StrictMode section is honest about measuring actual counts instead of guessing, which will save you from chasing phantom bugs when your spies expect 2 calls but now get 1.
- skills.sh installs
- 1.3K
- GitHub stars
- 41K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add github/awesome-copilot --skill react19-test-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
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:
actimport fix first, it unblocks everything elseSimulate→fireEventfix immediately after act- Full react-dom/test-utils cleanup remove remaining imports
- StrictMode call counts measure actual, don't guess
- Async act wrapping for remaining "not wrapped in act" warnings
- Custom render helper verify once per codebase, not per test
1. act() Import Fix
// Before REMOVED in React 19:
import { act } from 'react-dom/test-utils';
// After:
import { act } from 'react';
If mixed with other test-utils imports:
// Before:
import { act, Simulate, renderIntoDocument } from 'react-dom/test-utils';
// After split the imports:
import { act } from 'react';
import { fireEvent, render } from '@testing-library/react'; // replaces Simulate + renderIntoDocument
2. Simulate → fireEvent
Sponsors
Details
- Repository
- github.com/github/awesome-copilot
- Categories
- Frontend Development, Testing & QA, Git & Pull Requests, AI & Agent Building
- First seen
- May 16, 2026
More from github/awesome-copilot
All 318- Lsp Setup1.2K
- Agent Supply Chain1.1K
- Mcp Security Audit1.1K
- Arize Prompt Optimization1.1K
- Arize Ai Provider Integration1.1K
- Arize Evaluator1.1K
- React19 Concurrent Patterns1.1K
- Arize Dataset1.1K
- Arize Instrumentation1.1K
- Arize Annotation1.1K
- Integrate Context Matic1.1K
- Arize Experiment1.1K
- Arize Trace1.1K
- Arize Link1.1K
- Phoenix Evals1K
- Phoenix Tracing1K
- Onboard Context Matic1K
- Phoenix Cli1K
- React19 Source Patterns993
- Python Pypi Package Builder950
- Salesforce Apex Quality885
- React Audit Grep Patterns884
- Salesforce Flow Design839
- Github Release790