jest-to-vitest

Migrate Jest tests to Vitest within Matterbridge packages.

953|54|Updated Feb 22, 2024
One-click install
npx skills add https://github.com/Luligu/matterbridge --skill jest-to-vitest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jest-to-vitest
Source: https://github.com/Luligu/matterbridge/tree/main/.claude/skills/jest-to-vitest
Command: npx skills add https://github.com/Luligu/matterbridge --skill jest-to-vitest

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrating Jest tests to Vitest within a Matterbridge monorepo, preserving test logic while adopting Vitest tooling and lifecycle.

Core Features & Use Cases

  • Convert Jest test files to Vitest test files while keeping test structure and semantics intact.
  • Update the test harness and environment to use Vitest globals and the Matter lifecycle.
  • Use the reference pair as a migration guide to ensure consistent patterns across packages.

Quick Start

Relocate the test file to the corresponding vitest directory and update the harness to use Vitest globals according to the migration pattern.

Frequently Asked Questions about jest-to-vitest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate Jest tests to Vitest in a monorepo?

To migrate Jest tests to Vitest, relocate source test files from packages/*/src to a dedicated packages/*/vitest directory, preserving the test bodies while updating the harness to use Vitest globals and lifecycle conventions.

What is the process for moving Jest test files into a Vitest directory structure?

Moving Jest test files into a Vitest directory structure involves transferring files from packages/*/src to packages/*/vitest while keeping test semantics intact and updating the server lifecycle and test harness to align with Vitest tooling.

Does this Jest to Vitest migration preserve existing test logic and port management?

Yes, the Jest to Vitest migration preserves existing test bodies, structure, semantics, and port management, focusing solely on updating the test harness and environment to adopt Vitest globals and updated server lifecycle conventions.

Can I use this migration pattern to align test lifecycles with Matterbridge conventions?

Yes, this migration pattern is specifically designed to align test lifecycles with Matterbridge conventions by updating the test harness with vitest-utils and an updated server lifecycle when moving files to the vitest directory.

What do I need to update in the test harness when converting from Jest to Vitest?

When converting from Jest to Vitest, you need to update the test harness to use Vitest globals and the updated server lifecycle, using a reference pair as a migration guide to ensure consistent patterns across all packages.

Why move test files to a dedicated vitest directory instead of converting them in place?

Moving test files to a dedicated vitest directory separates the Vitest harness and lifecycle from source files, ensuring test lifecycles align with Matterbridge conventions while preserving the original test bodies and port management.