rstest-best-practices

Installation
SKILL.md

Rstest Best Practices

Apply these rules when writing or reviewing Rstest test projects.

Configuration

  • Use rstest.config.ts and defineConfig from @rstest/core
  • Prefer explicit imports import { test, expect, describe } from '@rstest/core' over globals: true
  • For Rsbuild projects, use @rstest/adapter-rsbuild with extends: withRsbuildConfig() to reuse build config
  • For Rslib projects, use @rstest/adapter-rslib with extends: withRslibConfig() to reuse build config
  • Use setupFiles for shared test setup (e.g., custom matchers, cleanup hooks)
  • When using Rsbuild plugins (e.g., @rsbuild/plugin-react), add them via the plugins field
  • For deep-level or advanced build configuration needs, use tools.rspack or tools.bundlerChain

CLI

Related skills
Installs
232
GitHub Stars
68
First Seen
Mar 16, 2026