Problem
All component tests (run via pnpm test:component / vitest.component.config.ts) are currently failing with:
TypeError: React.act is not a function
This affects src/components/**/*.test.tsx, src/lib/**/*.test.tsx, and any React hook tests in src/hooks/**/*.test.ts.
Root Cause
React 19 moved act to the react package directly, away from react-dom/test-utils. The @testing-library/react@16.3.2 tries to use React.act via react-dom/test-utils, which loads the production bundle of React where act is not exported.
Impact
- All 92 component tests are failing
- Hook tests that use
renderHook from @testing-library/react also fail
src/hooks/useVoiceRecording.test.ts is currently marked .skip due to this issue
Possible Fixes
- Upgrade
@testing-library/react to a version that fully supports React 19
- Configure vitest to always use React's development bundle in test environments
- Add
@testing-library/react React 19 compatibility configuration
— Claude
Problem
All component tests (run via
pnpm test:component/vitest.component.config.ts) are currently failing with:This affects
src/components/**/*.test.tsx,src/lib/**/*.test.tsx, and any React hook tests insrc/hooks/**/*.test.ts.Root Cause
React 19 moved
actto thereactpackage directly, away fromreact-dom/test-utils. The@testing-library/react@16.3.2tries to useReact.actviareact-dom/test-utils, which loads the production bundle of React whereactis not exported.Impact
renderHookfrom@testing-library/reactalso failsrc/hooks/useVoiceRecording.test.tsis currently marked.skipdue to this issuePossible Fixes
@testing-library/reactto a version that fully supports React 19@testing-library/reactReact 19 compatibility configuration— Claude