Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides before/after patterns for migrating test files to React 19 compatibility, including act() imports, Simulate removal, and StrictMode call count changes.
.claude/skills/react19-test-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 1% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -7% | 0% |
| case-15 | ✗→✓ | ▲ Improved | -33% | 0% |
| case-16 | ✗→✓ | ▲ Improved | -61% | 0% |
Reference for all test file migrations required by React 19.
Fix test files in this order; each layer depends on the previous:
act import fix first, it unblocks everything elseSimulate → fireEvent fix immediately after actjsx// Before REMOVED in React 19: import { act } from 'react-dom/test-utils'; // After: import { act } from 'react';
If mixed with other test-utils imports:
jsx// 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
jsx// 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 });
| 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 |
React 19 StrictMode no longer double-invokes useEffect in development. Spy assertions counting effect calls must be updated.
Strategy always measure, never guess:
bash# Run the failing test, read the actual count from the error: npm test -- --watchAll=false --testPathPattern="[filename]" --forceExit 2>&1 | grep -E "Expected|Received"
jsx// 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);
jsx// Render-phase calls (component body) still double-invoked in React 19 StrictMode: expect(renderSpy).toHaveBeenCalledTimes(2); // stays at 2 for render body calls
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-17 | pass→pass | 7,256 | 3,467 | -52% | 1 | 1 | 0% | 1,098 | 1,432 | +30% | 0 | 0 | — |
case-01 | fail→pass | 12,441 | 9,849 | -21% | 1 | 1 | 0% | 2,534 | 3,006 | +19% | 0 | 0 | — |
case-02 | fail→pass | 15,642 | 11,856 | -24% | 1 | 1 | 0% | 3,210 | 3,249 | +1% | 0 | 0 | — |
case-03 | fail→pass | 16,495 | 12,914 | -22% | 1 | 1 | 0% | 3,276 | 3,038 | -7% | 0 | 0 | — |
case-04 | pass→pass | 6,180 | 3,532 | -43% | 1 | 1 | 0% | 1,085 | 1,462 | +35% | 0 | 0 | — |
case-05 | pass→pass | 10,667 | 4,317 | -60% | 1 | 1 | 0% | 1,914 | 1,759 | -8% | 0 | 0 | — |
case-06 | pass→pass | 8,628 | 2,491 | -71% | 1 | 1 | 0% | 1,539 | 1,352 | -12% | 0 | 0 | — |
case-07 | pass→pass | 15,155 | 10,090 | -33% | 1 | 1 | 0% | 2,615 | 2,807 | +7% | 0 | 0 | — |
case-08 | pass→pass | 10,977 | 3,478 | -68% | 1 | 1 | 0% | 1,423 | 1,452 | +2% | 0 | 0 | — |
case-09 | pass→pass | 6,591 | 3,252 | -51% | 1 | 1 | 0% | 1,056 | 1,452 | +38% | 0 | 0 | — |
case-10 | pass→pass | 9,388 | 6,013 | -36% | 1 | 1 | 0% | 1,541 | 2,093 | +36% | 0 | 0 | — |
case-11 | pass→pass | 10,259 | 6,133 | -40% | 1 | 1 | 0% | 1,792 | 1,974 | +10% | 0 | 0 | — |
case-12 | pass→pass | 6,069 | 3,362 | -45% | 1 | 1 | 0% | 1,052 | 1,451 | +38% | 0 | 0 | — |
case-13 | pass→pass | 10,445 | 7,016 | -33% | 1 | 1 | 0% | 1,712 | 2,109 | +23% | 0 | 0 | — |
case-14 | pass→pass | 9,236 | 4,929 | -47% | 1 | 1 | 0% | 1,473 | 1,617 | +10% | 0 | 0 | — |
case-15 | fail→pass | 12,965 | 2,839 | -78% | 1 | 1 | 0% | 1,956 | 1,313 | -33% | 0 | 0 | — |
case-16 | fail→pass | 20,876 | 2,621 | -87% | 1 | 1 | 0% | 3,365 | 1,326 | -61% | 0 | 0 | — |
case-18 | fail→pass | 11,823 | 3,324 | -72% | 1 | 1 | 0% | 1,911 | 1,420 | -26% | 0 | 0 | — |
case-19 | pass→pass | 7,859 | 2,471 | -69% | 1 | 1 | 0% | 1,348 | 1,290 | -4% | 0 | 0 | — |
case-20 | pass→pass | 19,039 | 13,701 | -28% | 1 | 1 | 0% | 3,478 | 3,327 | -4% | 0 | 0 | — |
case-21 | fail→fail | 10,395 | 7,592 | -27% | 1 | 1 | 0% | 1,989 | 2,436 | +22% | 0 | 0 | — |
case-22 | pass→fail | 12,734 | 12,018 | -6% | 1 | 1 | 0% | 1,897 | 2,681 | +41% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/24/2026 | +36% |
Other measured skills in the registry, with their headline benchmark lift.