Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 4 configuration. Use for tests under Core's Vitest include paths, `vi.mock`/spies/timers, jsdom component tests, coverage output, focused reruns, or unit-test failures. Do not use for browser E2E flows or async Next.js Server Components.
.claude/skills/asymmetric-al-vitest/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 4% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 127% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 34% | 0% |
Use the repository harness as the source of truth. Core currently resolves Vitest 4.1.x from bun.lock; verify the exact version before relying on a newly introduced API.
Read these before changing tests or configuration:
vitest.config.ts — include globs, aliases, Node default environment,timeouts, mock clearing, setup, and the custom coverage provider.
tests/setup/unit-env.ts — safe env defaults and browser shims.scripts/verify/unit-tests.mjs — the full unit gate and platform behavior.docs/ai/rules/testing.md — repository-wide test and CI policy..next-docs/01-app/02-guides/testing/vitest.mdx when testing Next.js code.Do not use bun test; that selects Bun's test runner. Use Vitest through the committed scripts or bunx vitest.
bash# Full CI-equivalent unit suite with Core's coverage provider bun run test:unit # Focused file or directory while iterating bunx vitest run tests/unit/path/to/example.test.ts # Focused test name bunx vitest run tests/unit/path/to/example.test.ts -t "expected behavior" # Watch a focused surface bunx vitest tests/unit/path/to/example.test.ts # Structured failure report and targeted reruns bun run test:unit:feedback
public boundary. Prefer pure logic/unit coverage; use Playwright when the claim depends on a real browser, routing, hydration, or an async Server Component.
tests/unit,packages/api/tests/unit, or packages/auth conventions from vitest.config.ts; do not invent a disconnected test root.
node. Add// @vitest-environment jsdom only to files that need DOM APIs, and clean up rendered components and mutated globals.
vi.mock ishoisted. Use vi.hoisted for shared mock state, dynamic imports when a module must load after mocks, and vi.importActual for intentional partial mocks.
clearMocks: true clears call history but doesnot restore globals, timers, dates, env values, or spy implementations. Undo those changes in hooks.
bun run test:unit before handoff.
services. Use deterministic fakes at repository boundaries.
placeholders and intentionally clear the Supabase service-role key.
implementation order unless that order is itself the contract.
.only; use .skip/.todo only with a documented reason and no hiddenloss of required coverage.
totalScripts: 0 summary is not a line/branch quality signal. Do not claim a threshold the provider does not measure.
bun run test:unit passes.See references/upstream.md for the reviewed upstream source, version mismatch decision, license, and refresh workflow.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 12,955 | 7,222 | -44% | 1 | 1 | 0% | 2,308 | 2,147 | -7% | 0 | 0 | — |
case-11 | fail→fail | 10,339 | 6,748 | -35% | 1 | 1 | 0% | 2,081 | 2,316 | +11% | 0 | 0 | — |
case-01 | fail→pass | 10,119 | 5,487 | -46% | 1 | 1 | 0% | 1,958 | 2,035 | +4% | 0 | 0 | — |
case-02 | fail→fail | 7,990 | 5,413 | -32% | 1 | 1 | 0% | 1,485 | 1,270 | -14% | 0 | 0 | — |
case-03 | pass→pass | 10,556 | 15,573 | +48% | 1 | 1 | 0% | 2,355 | 4,695 | +99% | 0 | 0 | — |
case-04 | pass→pass | 10,945 | 8,444 | -23% | 1 | 1 | 0% | 2,048 | 2,477 | +21% | 0 | 0 | — |
case-06 | fail→pass | 9,476 | 3,720 | -61% | 1 | 1 | 0% | 1,626 | 1,726 | +6% | 0 | 0 | — |
case-07 | fail→pass | 4,562 | 2,146 | -53% | 1 | 1 | 0% | 1,061 | 1,382 | +30% | 0 | 0 | — |
case-08 | fail→pass | 3,652 | 2,782 | -24% | 1 | 1 | 0% | 662 | 1,504 | +127% | 0 | 0 | — |
case-09 | fail→pass | 5,992 | 3,070 | -49% | 1 | 1 | 0% | 1,155 | 1,551 | +34% | 0 | 0 | — |
case-10 | fail→pass | 12,978 | 6,907 | -47% | 1 | 1 | 0% | 2,366 | 2,387 | +1% | 0 | 0 | — |
case-12 | pass→pass | 10,927 | 10,010 | -8% | 1 | 1 | 0% | 2,019 | 2,891 | +43% | 0 | 0 | — |
case-13 | fail→fail | 5,840 | 3,069 | -47% | 1 | 1 | 0% | 1,223 | 1,533 | +25% | 0 | 0 | — |
case-14 | fail→pass | 8,188 | 4,043 | -51% | 1 | 1 | 0% | 1,471 | 1,702 | +16% | 0 | 0 | — |
case-15 | pass→pass | 12,214 | 5,024 | -59% | 1 | 1 | 0% | 2,234 | 2,048 | -8% | 0 | 0 | — |
case-16 | pass→pass | 10,332 | 6,335 | -39% | 1 | 1 | 0% | 1,650 | 2,184 | +32% | 0 | 0 | — |
case-17 | fail→fail | 10,452 | 4,758 | -54% | 1 | 1 | 0% | 1,705 | 1,848 | +8% | 0 | 0 | — |
case-18 | pass→pass | 10,326 | 6,746 | -35% | 1 | 1 | 0% | 1,992 | 2,193 | +10% | 0 | 0 | — |
case-19 | pass→pass | 10,058 | 6,960 | -31% | 1 | 1 | 0% | 1,991 | 2,087 | +5% | 0 | 0 | — |
case-20 | pass→fail | 9,835 | 4,327 | -56% | 1 | 1 | 0% | 1,609 | 1,629 | +1% | 0 | 0 | — |
case-21 | fail→pass | 8,714 | 5,032 | -42% | 1 | 1 | 0% | 1,372 | 1,773 | +29% | 0 | 0 | — |
case-22 | fail→fail | 6,693 | 1,238 | -82% | 1 | 1 | 0% | 1,342 | 1,171 | -13% | 0 | 0 | — |
case-23 | fail→fail | 7,689 | 1,602 | -79% | 1 | 1 | 0% | 1,525 | 1,197 | -22% | 0 | 0 | — |
case-24 | fail→fail | 6,544 | 1,670 | -74% | 1 | 1 | 0% | 985 | 1,157 | +17% | 0 | 0 | — |
case-25 | fail→pass | 12,428 | 3,331 | -73% | 1 | 1 | 0% | 2,126 | 1,585 | -25% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 24 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +32 percentage points is the difference between those two pass rates over the 24 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.