@vitejs/plugin-react for React support.
vitest.config.js file in your package root.
When writing a test file that uses React Testing Library to render components or reference any browser-specific APIs, add the following to the top of the file:
render function to work. Learn more about Vitest test environments