# React19 test patterns

> React19 test patterns is an open-source agent skill for developer tools. Guides migration of React test files to React 19 APIs and StrictMode behavior. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/github/awesome-copilot/tree/main/skills/react19-test-patterns
- **Repository:** https://github.com/github/awesome-copilot
- **GitHub stars:** 41,707
- **License:** MIT
- **Skill name:** react19-test-patterns
- **Collection:** https://github.com/github/awesome-copilot
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-30

## About

This skill is a reference for updating existing test files so they run under React 19. It groups the required changes into an ordered sequence, starting with moving act() to the react package and then replacing the removed Simulate helper with fireEvent from Testing Library. It also lists how the react-dom/test-utils functions map to Testing Library equivalents, such as render and getByRole, and notes which helpers can simply be deleted.

For StrictMode, the skill explains that React 19 no longer double-invokes effects in development, so spy counts on effects need lowering, while render-body calls still run twice. It recommends running the failing test and reading the actual call count from the output rather than adjusting numbers by guesswork. Async act wrapping for remaining warnings and a check on custom render helpers are included as later steps.

The patterns are written for Jest-style test runs and assume React Testing Library is in use for the replacement APIs.

## When your agent uses it

> Provides before/after patterns for migrating test files to React 19 compatibility, including act() imports, Simulate removal, and StrictMode call count changes.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/github/awesome-copilot/tree/HEAD/skills/react19-test-patterns)
- [License: MIT](https://github.com/github/awesome-copilot/tree/HEAD/skills/react19-test-patterns)

## Features

- **act import relocation:** Shows how to move act() from react-dom/test-utils to the react package.
- **Simulate to fireEvent swap:** Maps removed Simulate calls to equivalent Testing Library fireEvent calls.
- **test-utils API map:** Lists each removed react-dom/test-utils helper and its modern replacement.
- **StrictMode call count fixes:** Explains which effect and render call counts change under React 19 StrictMode.
- **Measure-first test updates:** Recommends reading actual counts from a failing test run before editing assertions.
- **Async act warning cleanup:** Covers wrapping remaining asynchronous updates to clear not-wrapped-in-act warnings.

## Good for

- Migrate a test file that imports act from react-dom/test-utils to React 19
- Replace Simulate.click and Simulate.change calls with fireEvent in Jest tests
- Update toHaveBeenCalledTimes assertions for effects under StrictMode in React 19
- Clear 'not wrapped in act' warnings in React component tests
- Remove leftover renderIntoDocument and findRenderedDOMComponent helpers

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/react19-test-patterns` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/react19-test-patterns &&
cp -R "$tmp/skills/react19-test-patterns" ~/.claude/skills/react19-test-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/react19-test-patterns` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/react19-test-patterns` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/react19-test-patterns &&
cp -R "$tmp/skills/react19-test-patterns" ~/.agents/skills/react19-test-patterns &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/react19-test-patterns` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/react19-test-patterns` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/react19-test-patterns &&
cp -R "$tmp/skills/react19-test-patterns" ~/.cursor/skills/react19-test-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/react19-test-patterns` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/github/awesome-copilot.git --path skills/react19-test-patterns
```

Or copy the folder to `~/.gemini/skills/react19-test-patterns` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/react19-test-patterns`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/github/awesome-copilot.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/react19-test-patterns &&
cp -R "$tmp/skills/react19-test-patterns" ~/.copilot/skills/react19-test-patterns &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/react19-test-patterns` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/github/awesome-copilot.git
```

Then copy `awesome-copilot/skills/react19-test-patterns` into your agent's skills folder as `react19-test-patterns`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does React19 test patterns change in my code?

It guides edits to test files: imports of act move to react, Simulate calls become fireEvent calls, and StrictMode spy counts for effects are lowered to match React 19 behavior.

### Which replacement libraries does React19 test patterns assume?

The replacement examples use @testing-library/react for render, fireEvent and query helpers.

### Does React19 test patterns include any scripts?

No scripts are bundled. It shows a single npm test command that filters output to expected and received counts.

### Should I change StrictMode counts by reasoning about React 19?

No. The skill advises running the failing test first and using the actual count reported in the output.

### How do I install React19 test patterns in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/react19-test-patterns to use it in all your projects, or to .claude/skills/react19-test-patterns in one project.

### Does React19 test patterns run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use React19 test patterns?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to React19 test patterns?

The closest alternatives to React19 test patterns are React19 concurrent patterns, React19 source patterns, React18 enzyme to rtl, React18 lifecycle patterns and React18 dep compatibility.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [React19 concurrent patterns](https://ai-powered.com/skills/react19-concurrent-patterns): React19 concurrent patterns is an open-source agent skill for developer tools.
- [React19 source patterns](https://ai-powered.com/skills/react19-source-patterns): React19 source patterns is an open-source agent skill for developer tools.
- [React18 enzyme to rtl](https://ai-powered.com/skills/react18-enzyme-to-rtl): React18 enzyme to rtl is an open-source agent skill for developer tools.
- [React18 lifecycle patterns](https://ai-powered.com/skills/react18-lifecycle-patterns): React18 lifecycle patterns is an open-source agent skill for developer tools.
- [React18 dep compatibility](https://ai-powered.com/skills/react18-dep-compatibility): React18 dep compatibility is an open-source agent skill for developer tools.
- [React18 batching patterns](https://ai-powered.com/skills/react18-batching-patterns): React18 batching patterns is an open-source agent skill for developer tools.
- [React audit grep patterns](https://ai-powered.com/skills/react-audit-grep-patterns): React audit grep patterns is an open-source agent skill for developer tools.
- [JavaScript TypeScript jest](https://ai-powered.com/skills/javascript-typescript-jest): JavaScript TypeScript jest is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/react19-test-patterns
