Source profileQuality 67/100Review permissions

github/awesome-copilot/skills/react19-test-patterns/SKILL.md

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.

Source repository stars
37,126
Declared platforms
0
Static risk flags
1
Last source update
2026-07-28
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Reference for all test file migrations required by React 19.

Best for

    Not for

    • Tasks that require unconfirmed production actions or broad system permissions.
    • Environments where the pinned source and install steps cannot be inspected.

    Compatibility matrix

    Platform support, with evidence labels

    PlatformStatusEvidenceWhat to check
    CodexNot declaredNo explicit evidencePortability before use
    Claude CodeNot declaredNo explicit evidencePortability before use
    CursorNot declaredNo explicit evidencePortability before use
    Gemini CLINot declaredNo explicit evidencePortability before use
    Open the compatibility checker

    Installation

    Inspect first. Install second.

    The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

    Source-detected install commandSource
    npx skills add https://github.com/github/awesome-copilot --skill "skills/react19-test-patterns"
    Safe inspection promptEditorial

    Inspect the Agent Skill "react19-test-patterns" from https://github.com/github/awesome-copilot/blob/9933dcad5be5caeb288cebcd370eeeb2fc2f1685/skills/react19-test-patterns/SKILL.md at commit 9933dcad5be5caeb288cebcd370eeeb2fc2f1685. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

    Workflow

    What the source asks the agent to do

    1. 01

      Priority Order

      Fix test files in this order; each layer depends on the previous:

      act import fix first, it unblocks everything elseSimulate → fireEvent fix immediately after actFull react-dom/test-utils cleanup remove remaining imports
    2. 02

      1. act() Import Fix

      If mixed with other test-utils imports:

      If mixed with other test-utils imports:
    3. 03

      2. Simulate → fireEvent

      Review the “2. Simulate → fireEvent” section in the pinned source before continuing.

      Review and apply the “2. Simulate → fireEvent” source section.
    4. 04

      3. react-dom/test-utils Full API Map

      Review the “3. react-dom/test-utils Full API Map” section in the pinned source before continuing.

      Review and apply the “3. react-dom/test-utils Full API Map” source section.

    Permission review

    Static risk signals and limitations

    Runs scripts

    medium · line 82

    The documentation asks the agent to run terminal commands or scripts.

    npm test -- --watchAll=false --testPathPattern="[filename]" --forceExit 2>&1 | grep -E "Expected|Received"

    Evidence record

    Why each signal appears

    EvidenceSourceComputedTestedEditorial
    SignalValueEvidence typeMeaning
    Quality score67/100ComputedDocumentation, specificity, maintenance, and trust rules
    Repository stars37,126SourceRepository attention, not individual Skill quality
    Compatibility0 platformsSourceDeclared in the catalog source record
    Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

    Pinned source

    Provenance and original SKILL.md

    Repository
    github/awesome-copilot
    Skill path
    skills/react19-test-patterns/SKILL.md
    Commit
    9933dcad5be5caeb288cebcd370eeeb2fc2f1685
    License
    MIT
    Collected
    2026-07-28
    Default branch
    main
    View the original SKILL.md

    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. SimulatefireEvent 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

    // Before  Simulate REMOVED in React 19:
    import { Simulate } from 'react-dom/test-utils';
    Simulate.click(element);
    Simulate.change(input, { target: { value: 'hello' } });
    Simulate.submit(form);
    Simulate.keyDown(element, { key: 'Enter', keyCode: 13 });
    
    // After:
    import { fireEvent } from '@testing-library/react';
    fireEvent.click(element);
    fireEvent.change(input, { target: { value: 'hello' } });
    fireEvent.submit(form);
    fireEvent.keyDown(element, { key: 'Enter', keyCode: 13 });
    

    3. react-dom/test-utils Full API Map

    Old (react-dom/test-utils)New location
    actimport { act } from 'react'
    SimulatefireEvent from @testing-library/react
    renderIntoDocumentrender from @testing-library/react
    findRenderedDOMComponentWithTaggetByRole, getByTestId from RTL
    findRenderedDOMComponentWithClassgetByRole or container.querySelector
    scryRenderedDOMComponentsWithTaggetAllByRole from RTL
    isElement, isCompositeComponentRemove not needed with RTL
    isDOMComponentRemove

    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:

    # Run the failing test, read the actual count from the error:
    npm test -- --watchAll=false --testPathPattern="[filename]" --forceExit 2>&1 | grep -E "Expected|Received"
    
    // Before (React 18 StrictMode  effects ran twice):
    expect(mockFn).toHaveBeenCalledTimes(2);  // 1 call × 2 (strict double-invoke)
    
    // After (React 19 StrictMode  effects run once):
    expect(mockFn).toHaveBeenCalledTimes(1);
    
    // Render-phase calls (component body)  still double-invoked in React 19 StrictMode:
    expect(renderSpy).toHaveBeenCalledTimes(2);  // stays at 2 for render body calls
    

    Alternatives

    Compare before choosing