Repository navigation
v1.0.0-beta.1
Pre-releaseInstall this beta with pnpm add -D @rstest/core@1.0.0-beta.1. For Browser Mode, install the matching @rstest/browser@1.0.0-beta.1 alongside core.
Breaking Changes
Failure screenshot filenames include the capture time
If your CI constructs paths to automatic failure screenshots, switch to the path printed by Rstest or collect .rstest/screenshots/**/*.png. The directory still identifies the test file, project, and browser. Each PNG now uses the test name and UTC capture time. For example, two captures of login failed in the same second produce login-failed-20261127-100245.png and login-failed-20261127-100245-2.png. #2188
Browser Mode requires Playwright 1.52 or later in the 1.x series
The Playwright peer range for @rstest/browser moves from ^1.49.1 to ^1.52.0. If your browser project pins Playwright 1.49–1.51, upgrade it alongside Rstest. The Node-side @rstest/playwright fixture package keeps its existing peer range. #2186
Locators now support count(), all(), and filter({ visible: true }). selectOption() returns the selected values, and expect.element(locator).toContainClass('active') checks for a class without matching the entire class attribute.
Highlights
Inspect failures directly in the headed browser
The Preview tab shows the live test while it runs. When a run fails, Results selects the first failed case or file error. For screenshot mismatches, compare Expected and Actual side by side and turn on Highlight changes to locate the differing pixels. After a passing run, select a file to see its cases and durations. #2165 · #2168 · #2170
Watch a test across browsers
Open several headed browsers at once, or keep Chromium visible for debugging while Firefox runs headless in the same watch session. In the terminal, press t to filter by test name, p to filter by file, or a to clear the filters and rerun all tests. Rerunning a case from a browser window targets that window. #2178 · #2180 · #2162
import { defineConfig } from '@rstest/core';
export default defineConfig({
browser: {
enabled: true,
provider: 'playwright',
instances: [
{ browserName: 'chromium', headless: false },
{ browserName: 'firefox', headless: true },
],
},
});Keep screenshots from flaky tests and tune visual assertions
With failure capture enabled, Rstest saves a PNG for every failed attempt, even when a later retry passes. To keep captures across runs while investigating a flaky test, run rstest run --browser.screenshotFailures.clean=false or set browser.screenshotFailures to { clean: false }. #2185 · #2187 · #2192
A toMatchScreenshot assertion can take just an options object and use the generated snapshot name. Set both pixel limits to enforce the stricter one. In this example, a difference must stay within both 100 pixels and 1% of the image. An existing reference passes on the first capture that matches within tolerance. #2158 · #2166 · #2156
await expect(page.getByRole('button', { name: 'Save' })).toMatchScreenshot({
maxDiffPixels: 100,
maxDiffPixelRatio: 0.01,
});Reuse VM workers across test environments
vmForks and vmThreads can reuse a worker when the next file needs a different environment. Each file still gets its own VM context and environment setup. In the focused vmForks benchmark below, reuse reduced worker startups and elapsed time for mixed Node/jsdom suites, with higher peak memory. The jsdom-only workload used four workers in both runs. #2144
| Workload | Wall time | Worker processes | Peak memory |
|---|---|---|---|
| 40 mixed Node/jsdom files | 1,378 → 613 ms | 28 → 4 | 399 → 513 MiB |
| 120 mixed Node/jsdom files | 3,032 → 747 ms | 115 → 4 | 419 → 600 MiB |
| 40 jsdom-only files | 614 → 614 ms | 4 → 4 | 546 → 548 MiB |
Medians from the worker-reuse change compared with v1.0.0-beta.0 on an Apple M4 Max, using Node 26.13.0, jsdom 26.1.0, and four workers. #2144
What's Changed
Breaking Changes 🍭
New Features 🎉
- feat(browser): support options-only screenshot assertions by @9aoy in #2158
- feat(browser): show test failure details below the live preview by @9aoy in #2165
- feat(browser): allow combined screenshot pixel limits by @9aoy in #2166
- feat(browser): compare screenshot mismatches in the headed UI by @9aoy in #2168
- feat(browser): show test results in the headed UI by @9aoy in #2170
- feat(browser): support multiple headed instances and mixed headed/headless watch by @fi3ework in #2178
- feat(browser): support t/p/a watch filter shortcuts in browser mode by @fi3ework in #2180
- feat(browser): align Locator and expect.element APIs with Playwright 1.52 by @fi3ework in #2186
- feat(browser): allow preserving failure screenshots across runs by @9aoy in #2187
- feat(cli): support --browser.screenshotFailures.clean by @9aoy in #2192
Performance 🚀
- perf(core): reuse VM workers across test environments by @9aoy in #2144
- perf(core): skip creating compilers for empty projects in non-watch and related runs by @fi3ework in #2147
- perf(browser): pass screenshot assertions on the first matching capture by @9aoy in #2156
- perf(core): cap concurrent environment builds by available CPUs by @9aoy in #2153
- perf(core): emit the ESM timers shim only when needed by @9aoy in #2173
- perf(browser): skip decoding byte-identical screenshot frames by @9aoy in #2175
- perf(core): emit Node federation runtime shims per project by @9aoy in #2176
- perf(browser): reuse decoded read-only screenshot references by @9aoy in #2177
- perf(core): avoid scanning mock registries when installing browser chunks by @9aoy in #2194
Bug Fixes 🐞
- fix(core): reset the non-TTY progress limit after output and per watch run by @gjreddy in #2142
- fix(core): include the error cause in the md report by @gjreddy in #2141
- fix(core): keep the cause of unhandled errors in the JSON reporter by @gjreddy in #2139
- fix(core): advance fake timers in rs.waitFor and rs.waitUntil by @gjreddy in #2143
- fix(core): filter missing modules before Rsbuild reports build failures by @9aoy in #2146
- fix(core): derive import.meta.url from __filename in lazy worker chunks by @9aoy in #2150
- fix(browser): increase the default screenshot stability timeout by @9aoy in #2154
- fix(browser): match the selected test when rerunning from the UI by @9aoy in #2162
- fix(browser): use screenshot tolerance for stability checks by @9aoy in #2159
- fix(browser): report missing read-only screenshot references before capture by @9aoy in #2160
- fix(adapters): support void return in modify*Config callbacks by @fi3ework in #2183
- fix(browser): keep failure screenshots across retries by @9aoy in #2185
Refactor 🔨
Document 📖
- docs: explain how to migrate Jest manual mocks for npm packages by @9aoy in #2152
- docs: audit and polish documentation against codebase by @fi3ework in #2132
- docs(website): redesign homepage with flat architectural grid and dither hero by @fi3ework in #2171
- docs: clarify test.extend type inference and explicit generics by @fi3ework in #2190
Other Changes
- chore(ci): scope main-push secondary e2e modes to ubuntu and add nightly sweep by @fi3ework in #2145
- chore(deps): update rsbuild and rspack by @renovate[bot] in #2148
- chore(ci): replace dynamic e2e matrix and test-gate with static jobs by @fi3ework in #2138
- chore(ci): schedule daily memory benchmark and revamp benchmark fixtures by @fi3ework in #2157
- chore(ci): raise memory benchmark test timeout and allow selecting suite on dispatch by @fi3ework in #2161
- chore: install Rstack agent skills with pnpm by @chenjiahan in #2163
- test(browser): restore screenshot dimension mismatch coverage by @9aoy in #2167
- test(browser): clean up locator fixture DOM between cases by @9aoy in #2172
- chore(ci): move CodSpeed schedules to off-peak minutes by @fi3ework in #2174
- chore(examples): polish product card controls in browser examples by @9aoy in #2179
- chore(deps): update dependency @rslib/core to ~1.1.0 by @renovate[bot] in #2182
- chore(ci): skip lint package build on docs-only PRs and enable coverage-v8 publish checks by @fi3ework in #2193
Full Changelog: v1.0.0-beta.0...v1.0.0-beta.1