status: active
timestamp: 2026-06-20
tags: [testing, unit, vitest, vite, ci, primary]
Vitest
Vite-native unit + integration test runner — free, OSS, fast
Vitest
Role
The family’s unit + integration test runner. Every Astro / React
package or site already runs on Vite, so Vitest shares the dev
config (path aliases, plugins, env loading) without a parallel
jest.config.ts. Used for:
- Pure-function tests in
@chirag127/oriz-kitand the other - React component logic with
@testing-library/react(browser behaviour goes through Playwright, not JSDOM) - Hono Worker handler tests using
@hono/vite-test-utils - Schema + zod validator round-trips against fixture JSONL from the lifestream canonical store
Free tier
- Unlimited — MIT OSS via
vitest - No account, no API key, no rate limit
- Watch mode + UI dashboard included free
- Native ESM, native TypeScript, no Babel
Card / subscription required?
NO. OSS — installed via pnpm add -D vitest @vitest/ui.
How CI consumes it
- name: Unit tests
run: pnpm vitest run --reporter=verbose --coverage
Coverage uploads to Sonarcloud via
its coverage/lcov.info artefact — same wiring the
code-quality stack
already expects.
Alternatives
- Jest — slower on Vite-native projects; requires duplicate config.
- Node
node:test— usable but no React / DOM helpers; rejected for the family’s React-heavy surface. - uvu / tape — too minimal for component-shaped suites.
Swap cost
Low — Vitest’s API is Jest-compatible (describe / it / expect).
A swap to Jest would be mechanical for the test files; the cost is
re-introducing a parallel config tree.
Why this is our pick
Same engine as the dev server (Vite), so reload loops are fast, config is unified, and ESM-only packages just work. Free, OSS, unlimited. Pairs with Playwright for E2E + Storybook/Chromatic for visual regression — the three-layer testing stack.
Cross-refs
- testing services index
- Playwright — E2E sibling
- Storybook — component sandbox sibling
- Chromatic — visual regression sibling
- Testing three-layer decision
- Code-quality stack decision
- Sonarcloud — coverage upload target
- No card-on-file rule