← ClaudeAtlas

migrate-to-rstestlisted

Migrate Jest or Vitest test suites and configs to Rstest. Use when asked to move from Jest/Vitest to Rstest, replace framework APIs with `@rstest/core`, translate test config to `rstest.config.ts`, or update test scripts and setup files for Rstest equivalents.
rstackjs/agent-skills · ★ 73 · Testing & QA · score 82
Install: claude install-skill rstackjs/agent-skills
# Migrate to Rstest ## Goal Migrate Jest- or Vitest-based tests and configuration to Rstest with minimal behavior changes. ## Migration principles (must follow) 1. **Smallest-change-first**: prefer the smallest viable change that restores test pass. 2. **Config before code**: prefer fixing in config/tooling/mocks before touching test logic. 3. **Do not change user source behavior**: avoid modifying production/business source files unless user explicitly requests it. 4. **Avoid bulk test rewrites**: do not refactor entire test suites when a local compatibility patch can solve it. 5. **Preserve test intent**: keep assertions and scenario coverage unchanged unless clearly broken by framework differences. 6. **Defer legacy runner removal**: keep Jest/Vitest dependency and legacy config during migration; remove only after Rstest tests pass. ## Workflow 1. Detect current test framework (`references/detect-test-framework.md`) 2. Open the official migration guide(s): - Jest: https://rstest.rs/guide/migration/jest.md - Vitest: https://rstest.rs/guide/migration/vitest.md - Prefer the `.md` URL form when available; Rstest pages provide Markdown variants that are more AI-friendly. 3. Dependency install gate (blocker check, see `references/dependency-install-gate.md`) 4. Apply framework-specific migration deltas: - Jest: `references/jest-migration-deltas.md` - Vitest: `references/vitest-migration-deltas.md` - Global API replacement rules: `references/global-api-mig