Use this boiler plate to use React Testing Library with Vite+React+Typescript , it uses Vitest instead of Jest.
With create-react-app (react v19) throwing errors and failing to install React Testing Library due to dependency issues , this is one setup that worked.