Skip to content
rstackjs avatar

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
View on GitHub

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 defineConfig setup guidance, environment choices for node, happy-dom, jsdom, and Browser Mode, and rules for rs.fn(), rs.spyOn(), and rs.mock()
  • Enforces no committed .only, explicit @rstest/core imports over globals: 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 -y

Installs 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 passWithNoTests unless 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 12

Similar to Rstest Best Practices

More Testing & QA