skills/migrate-to-rstest/SKILL.md
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.
npx skillsauth add rstackjs/agent-skills migrate-to-rstestInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Migrate Jest- or Vitest-based tests and configuration to Rstest with minimal behavior changes.
jest, vitest, adapters, environments) only when no other scope still relies on them — in a partial / mixed-mode monorepo migration that means the final scope, not the first. Leaving files behind "for reference" creates two source-of-truth configs. Framework-specific file enumeration: see the deltas reference.vi. / jest. / vitest. call site — no global aliasing, no local rebinding, no aliased imports. Full forbidden-form list and reasoning in references/global-api-migration.md.(; after every batch edit, grep describe\(|it\(|test\( to confirm no test name string was mutated. Regex template and rationale in references/global-api-migration.md.coverage.thresholds (lines/functions/branches/statements) to make a migrated suite pass. If thresholds fail under Rstest, investigate coverage.include / exclude / provider wiring before touching the numbers.references/detect-test-framework.md)references/dependency-install-gate.md).md URL form when fetching — Rstest pages provide Markdown variants that are more AI-friendly.
references/jest-migration-deltas.mdreferences/vitest-migration-deltas.mdreferences/global-api-migration.mdSee references/detect-test-framework.md for detection signals and the mixed-mode scope policy.
Before large-scale edits, verify dependencies can be installed and test runner binaries are available. Detailed checks, blocked-mode output format, and ni policy are in references/dependency-install-gate.md.
package.json, rstest.config.ts, include/exclude, test environment).@testing-library/jest-dom/vitest to matcher-based setup in Rstest).{ mock: true }, importActual).import.meta.url vs __dirname) in test/setup helpers.Principles 6–9 above are themselves red lines — the bullets below cover the scope / intent red lines not captured there:
If a fix would require either:
stop and provide:
output: {
externals: {
'fs-extra': 'commonjs fs-extra',
},
},
Use this when a dependency is being interpreted as the wrong module format under Rstest/Rspack.
rstest < 0.9.3 (fixed in 0.9.3 — upgrade before debugging mock behavior further).development
Debug Rstest issues systematically, including performance regressions. First determine whether the slowdown is in build startup or test execution, then run controlled config or code experiments and compare before/after timings.
development
Opinionated Rslib recommendations for modern JS/TS npm package design covering pure ESM, strict TypeScript, explicit exports, small stable APIs, pragmatic dependencies, accurate sideEffects, correct declarations, package validation, provenance, README.md, and AGENTS.md. Use when the user wants to make a JS/TS package more modern, check whether the current package setup is healthy, review package.json/exports/types/dependencies/docs/release readiness, or apply a modern library baseline.
development
Create or update draft GitHub releases for the current project's main GitHub repository, then organize GitHub-generated release notes into user-friendly sections without rewriting release note items. Use for preparing, formatting, categorizing, creating, or updating GitHub release notes or draft releases, including optional highlights when the user asks for them.
tools
Migrate ESLint or other linters to Rslint. Use when asked to replace ESLint flat config, lint scripts, VS Code ESLint settings, inline directives, rules, presets, plugins, or lint dependencies with Rslint equivalents.