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/guide/start/index.md.
close
  • English
  • Introduction

    Rstest is a JavaScript and TypeScript testing framework built on Rspack and Rsbuild. It provides Jest-compatible APIs with built-in support for TypeScript, ESM, CJS, and CSS Modules.

    ✨ Why Rstest

    Built on Rspack and Rsbuild, Rstest runs TypeScript, ESM, CJS, and CSS Modules out of the box—you can adopt it without migrating your existing build setup.

    If your project already uses Rstack tools (Rspack, Rsbuild, or Rslib), Rstest reuses your existing module resolution, code transforms, and plugins through adapters instead of maintaining a separate test config.

    Rstest executes tests with a dependency-graph bundle model rather than transforming files one by one. Build-time optimizations—such as tree-shaking and skipping unused re-exports in side-effect-free barrel files—cut redundant module compilation and execution in large projects and keep test behavior closer to production output. See Module side effects for how sideEffects declarations affect initialization imports.

    🔥 Roadmap

    Rstest supports Node.js and DOM testing, Browser Mode, Playwright E2E testing, mocking, multi-project workspaces, and code coverage, and is used across Rstack projects including Rsbuild, Rslib, and Rspack.

    See the Rstest Roadmap for upcoming plans.

    🦀 Rstack

    Rstest is part of Rstack, the fast, unified JavaScript toolchain for developers and agents.

    Rstack

    Rstack includes the following tools:

    NameDescriptionVersion
    RspackBundlernpm version
    RsbuildBuild toolnpm version
    RslibLibrary development toolnpm version
    RspressStatic site generatornpm version
    RsdoctorBuild analyzernpm version
    RstestTesting frameworknpm version
    RslintLinternpm version
    Rstack CLIUnified CLInpm version

    📦 Core packages

    Rstest's base runner is provided by @rstest/core. Install the additional packages below as needed for Browser Mode, E2E testing, coverage, or Rstack config reuse:

    NameDescriptionVersion
    @rstest/coreCore testing frameworknpm version
    @rstest/browserBrowser Mode supportnpm version
    @rstest/browser-reactReact component testingnpm version
    @rstest/playwrightPlaywright E2E fixturesnpm version
    @rstest/coverage-v8V8 coverage providernpm version
    @rstest/coverage-istanbulIstanbul coverage providernpm version
    @rstest/adapter-rsbuildReuse Rsbuild confignpm version
    @rstest/adapter-rslibReuse Rslib confignpm version
    @rstest/adapter-rspackReuse Rspack confignpm version

    🧑‍💻 Community

    Come and chat with us on Discord! The Rstack team and users are active there, and we're always looking for contributions.