migrate-to-rstest
БесплатноБез исполняемых скриптовНе проверенMigrate Jest, Vitest, or Playwright Test to Rstest while preserving test discovery, assertions, mocks, snapshots, and coverage.
от rstackjs★ 101 звезда на GitHubОб этом скилле
Migrate to Rstest
Goal
Migrate the smallest runnable Jest, Vitest, or Playwright Test scope with minimal behavior change. Use documentation and types that match the installed Rstest version; use latest online docs only after the capability gate confirms they apply.
Workflow
- Detect the runner, environment, Rstack integration, and smallest runnable scope with
references/detect-test-framework.md. - Run
references/dependency-install-gate.mdbefore choosing Rstest, coverage, adapter, or plugin APIs. - Before editing, record the exact command, Node and runner versions, environment, files/tests/skips/snapshots, and failures. Capture the pre-migration test manifest and follow
references/discovery-parity.mdthroughout the migration. - For Jest read
references/jest-migration-deltas.md; for Vitest readreferences/vitest-migration-deltas.md; for global APIs also readreferences/global-api-migration.md; for a detected Playwright Test runner readreferences/playwright-migration-deltas.md. Do not load the Playwright path for a browser-only request whose runner is not Playwright Test. Migrate scripts, config, and setup before editing test bodies; prefer adapter or Rsbuild/Rspack fixes over broad test rewrites. - If config loading emits
[MODULE_TYPELESS_PACKAGE_JSON], usereferences/config-module-type.md. Do not suppress the warning or change the whole package module type without an audit. - Get the migrated scope semantically green. Fix failures in this order: dependency skew, config/resolver, discovery, setup/environment/coverage, mocks/timers/snapshots, then test bodies.
- Compare the post-migration manifest and execution counts with the baseline. Classify every added, removed, skipped, or excluded test explicitly; do not call a run equivalent merely because it is green. For Jest snapshot migrations, also complete the snapshot cleanup and
uncheckedvalidation inreferences/jest-migration-deltas.md. - Remove temporary aliases, diagnostic hooks, and copied legacy workarounds that are no longer required. Keep only configuration proven necessary by behavior or measurement.
- If the migration misses its performance target or regresses in wall time, build time, test runtime, output volume, or memory, follow
rstest-debuggingwhen available. Otherwise usereferences/performance-diagnosis.md. If repeated worker startup or per-file dependency compilation dominates, use the pool comparison in that workflow to evaluatevmForksorvmThreads. - After correctness and performance validation, remove only legacy files and dependencies owned by the migrated scope. Summarize behavior parity, discovery differences, unsupported fields, retained compatibility config, performance tradeoffs, and TODOs.
Guardrails
- Keep the smallest viable scope. Do not broaden a monorepo migration because scopes share a lockfile.
- Do not change production behavior, assertions, test names, scenarios, coverage thresholds, or ignore directives to make migration pass.
- Do not introduce
jest/vishims or aliases; rewrite call sites withreferences/global-api-migration.md. - Do not silently drop unknown config fields or historical excludes. Verify, replace, or report each one.
- Compare the same test manifest under the same Node version, coverage mode, and cache conditions. Change one tuning option at a time and keep worker settings fixed unless testing that option.
- Keep the previous runner until Rstest is green. Use a local Rstest checkout only for labeled diagnostics, then validate the final result with the project's installed dependency.
- Escalate before many test edits or any production-source change: report why smaller config/setup fixes failed, options, risks, and the recommended path.
High-risk Rstest deltas
rstest/rstest runis single-run; watch mode isrstest --watchorrstest watch.globalsdefaults tofalse; preserving global APIs requiresglobals: trueand@rstest/core/globalstypes.- Rstest builds before tests run.
rs.mock()is runtime replacement and does not by itself prune the real module graph. - Dependency bundling trades compiler work for runtime Node loading. Neither “bundle all” nor “externalize all” is universally faster; measure a representative file and the full scope.
- An externalized runtime mock must match the exact request and module format. A config-wide external is unsafe when any test needs the real module.
Установить migrate-to-rstest в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл migrate-to-rstest?
Migrate Jest, Vitest, or Playwright Test to Rstest while preserving test discovery, assertions, mocks, snapshots, and coverage.
Как установить скилл migrate-to-rstest?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл migrate-to-rstest запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic