New advertisers: 50% off your first month with code FIRSTMONTHSee slots
github avatar

React19 Test Patterns

Migration patterns for React 19 test files, covering act() imports, Simulate-to-fireEvent swaps, and StrictMode call counts.

skills.sh installs
1.3K
GitHub stars
41.4K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the six-step fix order, from the act import fix through custom render helper verification
  • Includes before/after snippets for act, Simulate replaced by fireEvent, and a full react-dom/test-utils API map
  • Maps removed helpers such as renderIntoDocument and findRenderedDOMComponentWithTag to Testing Library queries
  • Designed for teams migrating Jest or React Testing Library suites to React 19 compatibility

Install

$ npx -y skills add github/awesome-copilot --skill react19-test-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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:

  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

// 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

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

Similar to React19 Test Patterns

More Testing & QA