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 includes the following tools:
📦 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:
🔗 Links
- awesome-rstack: A curated list of awesome things related to Rstack.
- rstack-examples: Examples showcasing Rstack tools.
- storybook-rsbuild: Storybook builder powered by Rsbuild.
- rsbuild-plugin-template: Use this template to create your own Rsbuild plugin.
- rstack-design-resources: Design resources for Rstack.
- Rslint: Configure Rslint's built-in rules for Rstest tests.
🧑💻 Community
Come and chat with us on Discord! The Rstack team and users are active there, and we're always looking for contributions.