/fuse-typescript:ts-testingfrom fuse-typescript
Helps choose between bun test and Vitest for TypeScript projects, then configure the selected runner with Jest-like API, coverage thresholds, and deterministic test isolation.
Ships in fuse-typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
It also covers coverage thresholds, deterministic test isolation, and the rule to never mix bun:test and vitest imports in one package, or run bun test when the configured runner is actually Vitest.
Out of scope: framework-specific testing (React components → react-expert's react-testing, Laravel → laravel-testing) and browser E2E suites are not covered.
Pick the right runner, then write tests with a shared Jest-compatible API.
Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:
After implementation, run fuse-ai-pilot:sniper for validation.
Both runners share a Jest-like API (describe/it/expect, lifecycle hooks,
snapshots, mocks). They differ on speed, coverage maturity, and CI scaling.
| Runner | Strength | Weakness |
|---|---|---|
bun test | Fastest cold start, zero-config TS/JSX, built-in; --parallel workers + --shard (1.3.13+) | Single process unless --parallel, experimental coverage, mock limits |
| Vitest | V8/Istanbul coverage, multi-worker CI scaling, ~Jest parity, browser mode | Needs Vite (peer dep in 5.x) + config, slower cold start |
bun:test and vitest importsbun run test, not bun test, when the runner is Vitest - Else Bun runs its own--randomize (Bun) to catch order bugsChoosing a runner?
├── Greenfield, Bun runtime, fast local TDD → bun test
├── Large suite / heavy CI parallelism → Vitest (multi-worker)
├── Migrating from Jest / need full coverage → Vitest (V8 + Istanbul)
├── Component/DOM in real browser → Vitest browser mode (Playwright)
└── Zero-dependency script or CLI → bun test
→ See references/choosing-runner.md for the full matrix
| Topic | Reference | Load when |
|---|---|---|
| Runner selection | references/choosing-runner.md | Deciding bun test vs Vitest |
| Bun test runner | references/bun-test.md | Using bun test |
| Vitest | references/vitest.md | Using Vitest |
| Shared API | references/common-patterns.md | Writing describe/it/mock/snapshot |
| Template | Use Case |
|---|---|
references/templates/bun-setup.md | bunfig.toml + first Bun tests |
references/templates/vitest-setup.md | vitest.config.ts + coverage + CI |
import { test, expect } from "bun:test";
test("2 + 2", () => {
expect(2 + 2).toBe(4);
});
bun test --coverage
→ See references/templates/bun-setup.md
import { test, expect } from "vitest";
test("adds 1 + 2", () => {
expect(1 + 2).toBe(3);
});
npx vitest run --coverage
→ See references/templates/vitest-setup.md
*.test.ts next to sourcewaitFor/async blockWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
7 skills in this plugin
/ts-configUse when creating or migrating a tsconfig.json, choosing module/moduleResolution, or fixing TS 6.0 deprecations that are hard errors in TS 7.0. Not for language syntax (ts-language-patterns)./ts-language-patternsUse when writing or reviewing modern TS syntax — const type parameters, using/await using, standard decorators, satisfies, or LLM anti-patterns (legacy enum/namespace). Not for tsconfig (ts-config)./ts-lint-formatUse when choosing or configuring a TS linter/formatter — Biome 2.x vs ESLint 10 flat config + typescript-eslint typed linting. Not for type checking itself (ts-config)./ts-packagingUse when publishing a TypeScript library — exports map, JSR vs npm, dual ESM/CJS, type validation, provenance. Not for application deployment./ts-runtime-bunUse when running TypeScript on Bun — bunfig.toml, bun test, Bun.build/--compile, or Bun workspaces. Not for Node.js runtime setup (ts-runtime-node)./ts-runtime-nodeUse when running TypeScript directly on Node.js without a build step — native type stripping, its limits, or when to reach for tsx. Not for Bun (ts-runtime-bun).npx claudepluginhub fusengine/claude-plugins --plugin fuse-typescriptOther plugins' skills for the same job