For AI agents: the complete documentation index is available at https://rstest.rs/llms.txt, the full documentation bundle is available at https://rstest.rs/llms-full.txt, and this page is available as Markdown at https://rstest.rs/index.md.
close
  • English
  • Rspack-basedTesting Framework

    Fast, build-integrated testing for JavaScript and TypeScript

    >
    Set up Rstest in this project: https://rstest.rs/guide/start/agent-install.md

    01

    Covers the languages, frameworks, and runtimes of modern JavaScript projects

    A modern testing framework

    One framework for Node.js, jsdom, and real browsers

    • TypeScript, CSS, and more work out of the box
    • Component testing for mainstream frameworks
    • Loads real Module Federation remotes instead of mocks
    Learn more

    02

    Powered by Rspack and Rsbuild for fast test compilation and a rich plugin ecosystem

    Rspack speed, Rsbuild ecosystem

    Tests are compiled by Rspack and share the config and plugin system of Rsbuild, ready out of the box and easy to extend

    • Utilizes Rust-based Rspack and SWC for fast test compilation
    • Compatible with Rsbuild plugins, including official ones such as React and Sass
    • Supports Rsbuild and Rspack config options, configured the same way
    Learn more

    03

    Run tests in Chromium, Firefox, and WebKit via Playwright, covering what a simulated DOM can't

    Real browsers, real DOM

    Tests run in real browsers launched by Playwright, with the same rendering, interactions, and browser APIs as production

    • Covers real layout, computed styles, Canvas, and Web Workers
    • Query elements with the Playwright-style Locator API
    • Assert with the auto-waiting expect.element
    Learn more

    04

    Reuse build config from Rsbuild, Rslib, Rspack, Lynx, and Modern.js projects through adapters

    Reuse your build config

    Adapters extract and convert the config tests need, while Rstest keeps control of test entries and runtime

    • Reuse plugins, aliases, and SWC options from your build config
    • Keep tests consistent with your project config
    • No duplicate config to maintain
    Learn more

    05

    Compatible with Jest and Vitest APIs and CLI, with guides for a smooth migration

    Jest-compatible APIs

    Assertions, mocks, snapshots, lifecycle hooks, projects, and coverage follow Jest and Vitest conventions

    • Familiar describe, test, expect, and snapshot APIs
    • Enable globals to use test APIs without imports
    • Adopt Browser Mode and adapters as needed
    Learn more

    06

    Drive a local dev server, preview server, or deployed app with Playwright for end-to-end verification

    End-to-end in the same runner

    Use Playwright browser automation in Rstest to verify complete page and app flows

    • Ready-to-use browser, context, page, and request fixtures
    • Playwright-style assertions for pages and locators
    • Unit and E2E tests share one runner, config, and reporting workflow
    Learn more