ts-testing

Select and configure bun test or Vitest for TypeScript test suites.

1|Updated Jul 29, 2026
One-click install
npx skills add https://github.com/fusengine/kimi-code --skill ts-testing-fusengine
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ts-testing
Source: https://github.com/fusengine/kimi-code/tree/main/plugins/typescript-expert/skills/ts-testing
Command: npx skills add https://github.com/fusengine/kimi-code --skill ts-testing-fusengine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Choosing and configuring a TypeScript test runner is confusing: bun test and Vitest share a Jest-like API but differ in cold-start speed, coverage maturity, CI parallelism, and mocking behavior. This Skill provides a decision matrix, configuration templates, and shared test-writing patterns so you pick the right runner and avoid mixing incompatible setups. ## Core Features & Use Cases - Runner Decision Matrix: Compare bun test vs Vitest across cold start, coverage, CI scaling, browser mode, and mocking to pick the right tool for your project shape. - Complete Setup Templates: Ready-to-use bunfig.toml and vitest.config.ts configurations with coverage thresholds, setup files, and GitHub Actions CI workflows. - Shared Jest-Compatible Patterns: Write portable describe/it/expect tests with lifecycle hooks, mocks, and snapshots that migrate between runners with minimal changes. - Use Case: You are starting a new Bun-based TypeScript service and need tests with coverage gating in CI. The Skill guides you to bun test, provides the bunfig.toml with coverage thresholds, and a GitHub Actions workflow. ## Quick Start Ask the assistant to set up Vitest with V8 coverage thresholds and a CI workflow for your TypeScript project, or to help decide between bun test and Vitest for your suite.

Frequently Asked Questions about ts-testing

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

FAQPage Schema
How do I choose between bun test and Vitest for TypeScript?▼

Choose bun test for greenfield Bun projects, fast local TDD, and zero-config TS/JSX. Choose Vitest for large suites needing multi-worker CI parallelism, mature V8/Istanbul coverage with thresholds, Jest migration, or real-browser component testing via Playwright.

How do I set up Vitest coverage thresholds in CI?▼

Install vitest and @vitest/coverage-v8, then configure test.coverage in vitest.config.ts with provider v8 and thresholds for lines, functions, branches, and statements. CI fails automatically when coverage drops below the configured targets.

Can I mix bun test and Vitest in the same package?▼

No, never mix bun:test and vitest imports in one package. Also run bun run test instead of bun test when Vitest is the configured runner, otherwise Bun executes its own runner instead of Vitest.

Does bun test support code coverage?▼

Bun test supports coverage via the --coverage flag with text and lcov reporters, configurable in bunfig.toml. However, coverage is experimental and numbers can shift across releases, so it should not be the sole quality gate on large suites.

How do I migrate tests from Jest to Vitest or bun test?▼

Test bodies using describe, it, expect, snapshots, and lifecycle hooks rarely change since both runners are Jest-compatible. The migration cost is config, coverage wiring, and mock APIs: mock.module maps to vi.mock, and jest.fn maps to vi.fn.

What are the limitations of bun test mocking?▼

Bun's mock.module may not intercept re-exports and dynamic import() calls as expected, so verify mocks actually apply. Bun also runs tests in a single process by default, limiting worker-level isolation for heavy suites compared to Vitest's forks or threads pools.