Rstest Best Practices
Rstest testing rules covering config, mocking, snapshots, coverage, CI sharding, and VM pool tuning.
- CCM score
- 63 of 100
- skills.sh installs
- 1.6K
- GitHub stars
- 101
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers project setup, test writing, mocking, snapshot and coverage practices, CI runs, worker pool tuning, and first-line debugging
- Includes
defineConfigsetup guidance, environment choices for node, happy-dom, jsdom, and Browser Mode, and rules forrs.fn(),rs.spyOn(), andrs.mock() - Enforces no committed
.only, explicit@rstest/coreimports overglobals: true, and reviewed snapshot updates - Designed for developers writing, reviewing, or troubleshooting Rstest test projects in CI or local workflows
Install
$ npx -y skills add rstackjs/agent-skills --skill rstest-best-practices -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/rstackjs/agent-skills
- Categories
- Testing & QA, Frontend & UI Code
- First seen
- Jun 3, 2026
Questions
What does the rstest-best-practices skill do?
rstest-best-practices gives an agent guidance for setting up, writing, reviewing and troubleshooting Rstest test projects. It covers config, CLI workflow, mocking, snapshot testing, DOM testing, coverage, multi-project setup, CI integration, performance and debugging.
How do I install the rstest-best-practices skill?
Run npx -y skills add rstackjs/agent-skills --skill rstest-best-practices -y in a project to install the rstest-best-practices skill. After that, the agent can apply Rstest rules when you write or review tests in that project.
Which Rstest tasks does rstest-best-practices help with most?
rstest-best-practices covers choosing a test environment such as node, happy-dom, jsdom or Browser Mode, and it explains when to mock with rs.mock, rs.spyOn or rs.fn. It also guides sharded CI runs with blob reporters and VM worker pool tuning for faster suites.
Where does rstest-best-practices fit among other testing skills?
rstest-best-practices is listed in the Testing & QA category on Claude Marketplaces, next to tdd and webapp-testing. Unlike those general test-driven or web app skills, rstest-best-practices is focused on the Rstest framework's config, mocks, snapshots and worker pools.
More from rstackjs/agent-skills
All 12Similar to Rstest Best Practices
More Testing & QAvitestpproenca/dot-skills8.4K installsCatalog of 44 Vitest best-practice rules covering async tests, setup, mocking, performance, and snapshots.
migrate-to-rstestrstackjs/agent-skills446 installsStep-by-step migration workflow that moves Jest, Vitest, or Playwright Test suites to Rstest with parity checks.
javascript-typescript-jestgithub/awesome-copilot14.8K installsBest practices for Jest tests in JavaScript and TypeScript covering structure, mocking, async code, and React.
testing-best-practicesasyrafhussin/agent-skills1K installsPractical TDD and unit/integration testing guidelines with 34 TypeScript rules across seven prioritized categories.
javascript-testing-patternswshobson/agents21.8K installsComprehensive testing guide covering Jest and Vitest setup, unit, async, and mocking patterns for JavaScript and TypeScript.
python-testing-patternswshobson/agents42.2K installsComprehensive pytest guide covering fixtures, mocking, parameterization, and test-driven development workflows for Python.