rstest-best-practices
Installation
SKILL.md
Rstest Best Practices
Apply these rules when writing or reviewing Rstest test projects.
Configuration
- Use
rstest.config.tsanddefineConfigfrom@rstest/core - Prefer explicit imports
import { test, expect, describe } from '@rstest/core'overglobals: true - For Rsbuild projects, use
@rstest/adapter-rsbuildwithextends: withRsbuildConfig()to reuse build config - For Rslib projects, use
@rstest/adapter-rslibwithextends: withRslibConfig()to reuse build config - Use
setupFilesfor shared test setup (e.g., custom matchers, cleanup hooks) - When using Rsbuild plugins (e.g.,
@rsbuild/plugin-react), add them via thepluginsfield - For deep-level or advanced build configuration needs, use
tools.rspackortools.bundlerChain