Rspack-basedTesting Framework
Fast, build-integrated testing for JavaScript and TypeScript
Set up Rstest in this project: https://rstest.rs/guide/start/agent-install.md01
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
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
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
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
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
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
07
The fast, unified JavaScript toolchain for developers and agents
Rspack
rspack.rsA fast Rust-based bundler for the web, with a modernized webpack API
Rsbuild
rsbuild.rsA fast, extensible build tool for modern web development, powered by Rspack
Rslib
rslib.rsAn Rsbuild-based library development tool for creating libraries and UI components

Rspress
rspress.rsAn Rsbuild-based static site generator for creating documentation sites

Rsdoctor
rsdoctor.rsAn AI-friendly build analyzer that makes the build process transparent
Rstest
rstest.rsA JavaScript testing framework powered by Rspack, with a Jest-compatible API
Rslint
rslint.rsA high-performance, ESLint-compatible linter for JavaScript and TypeScript
Rstack CLI
rstack.rsOne CLI that covers development, builds, testing, linting, and formatting