Rendering React Components in Browser Mode

If you are testing React components already then you are probably using React Testing Library and know about the render() function.

There is a similar function that you use for testing React components in Vitest Browser Mode.

import { renderHook } from 'vitest-browser-react';

In this lesson we'll dive into how to use render() in Vitest Browser Mode, and explain why you have to await it!

Loading full lesson...