测试与安全

rstest-best-practices

rstackjs/agent-skills

Set up, write, or review Rstest tests and configuration, including environments, mocks, snapshots, coverage, and CI.

  • 1421 次安装
  • 97 星标
  • 收录于

安装命令

npx skills add https://github.com/rstackjs/agent-skills --skill rstest-best-practices

SKILL.md

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