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

    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

    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

    • Fast compilation powered by Rust-based Rspack and SWC
    • Compatible with Rsbuild plugins like React and Sass
    • Shares Rsbuild and Rspack config options directly

    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

    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 build config
    • Keep tests consistent with your project config
    • No duplicate config to maintain

    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

    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 reporter