close
logo
Rstest
Guide
Config
API
English
简体中文
Guide
Config
API
English
简体中文
logo
Rstest

Getting Started

Introduction
Quick start
Features

Basic

CLI
Configure Rstest
Filtering tests

Advanced

Debugging
Profiling

Migration

Migrating from jest
📝 Edit this page on GitHub
Previous PageQuick start
Next PageCLI

#Features

Here you can learn about the key features supported by Rstest.

#Reuse the Rstack ecosystem

Rstest can directly reuse Rsbuild and Rspack configurations and plugin ecosystems. You can use the same configuration for both development and testing to enjoy a consistent experience across the Rstack toolchain.

Learn more about Configuring Rstest.

#Built on Rspack

Rstest is powered by Rspack, enabling high-performance builds and optimizations such as Tree Shaking and lazyBarrel.

#Multi-project testing

Rstest provides multi-project testing capabilities, allowing you to run tests for multiple projects in parallel within a single Rstest process.

Learn more about Projects.

#In-source tests

Rstest supports a Rust-like module testing style, allowing you to write test blocks directly inside source files. This approach is ideal for small utility functions and helpers, enabling quick verification and debugging.

Learn more about In-source tests.

#Watch mode

When you modify a test file or one of its dependencies, Rstest analyzes the module graph and only re-runs the affected test files, significantly improving local feedback speed.

#DOM testing

Rstest supports simulating the DOM and browser APIs using jsdom and happy-dom. It provides solid support for frameworks such as React and Vue, and is compatible with Testing Library and CSS Modules.

Learn more about DOM testing.

#Code coverage

Rstest supports code coverage collection using istanbul. You can enable code coverage collection by setting coverage.enabled to true in your Rstest configuration file.

Learn more about Code coverage.

#More capabilities

  • Jest-compatible assertions and snapshot testing
  • Mock / Spy utilities
  • File-level sandbox isolation
  • Rich lifecycle hooks
  • Reporters and CI integration
  • Filtering by directory / project / test name