
Rstest Best Practices
This is a comprehensive reference for writing and maintaining Rstest test suites, covering everything from basic test APIs to advanced CI and performance tuning. You'll want this when setting up a new Rstest project, debugging flaky tests, or optimizing slow test runs. It includes adapter patterns for Rsbuild and Rslib, proper async assertion patterns (using resolves/rejects matchers instead of try/catch), and practical advice on sharding for parallel CI execution. The coverage of multi-project monorepo setup and the debugging section with Rsdoctor profiling tips are especially useful. One caveat: it assumes you're already committed to the Rstest ecosystem rather than comparing it to alternatives.
- skills.sh installs
- 1.5K
- GitHub stars
- 98
- last updated
- Aug 21, 2026
Install
$ npx -y skills add rstackjs/agent-skills --skill rstest-best-practices --agent claude-codeInstalls into .claude/skills of the current project.
Files
Rstest best practices
Apply these rules when setting up, writing, or reviewing Rstest projects.
Workflow
- Inspect the existing package manager, dependency policy, module mode, build configuration, test layout, and framework conventions before editing.
- Add
@rstest/core, a package-local test script, and a config file whose extension matches the package's module mode. - Reuse existing build configuration only when doing so lowers maintenance cost and remains compatible. An adapter is optional; use an independent Rstest config when adapter integration is incompatible or disproportionately costly, and explicitly reproduce required aliases, plugins, defines, environments, and externals.
- Configure test discovery, environment, and setup files intentionally. Do not enable
passWithNoTestsunless an empty test set is an expected and documented state. - Verify test discovery with
rstest list, then run focused tests, the full suite, and the project's existing build or type-check command.
Configuration and environments
Sponsors
Details
- Repository
- github.com/rstackjs/agent-skills
- Categories
- Frontend Development, Testing & QA, Documentation, AI & Agent Building, Debugging, Automation & Workflows, CLI & Terminal
- First seen
- Jun 3, 2026