migrate-to-rstestlisted
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