Library
TestingPreact Testing Library
Testing Library integration focused on user-centric testing for Preact components.
Native PreactActive
Native Preact
Built for Preact and does not require a React compatibility layer.
Package@testing-library/preact
npm install @testing-library/preactimport { render, screen } from "@testing-library/preact";import { Counter } from "./Counter"; render(<Counter />);screen.getByRole("button", { name: /count/i });Introduction
If you already like Testing Library's approach, this is the natural choice for Preact component tests.
Preact configuration
Works with Vitest or Jest-style environments that provide a DOM.
SSR notes
This package is test-only and usually runs in jsdom rather than on a real server renderer.
Islands notes
Very useful for testing interactive islands in isolation.