# Vitest vs. bun test vs. node:test · a built-in-ek beérték

> Három évig a vitest volt a magától értetődő válasz. 2026-ban a beépített runner-ek (bun test, node:test) elég jók ahhoz, hogy a választás ne reflex legyen.

Default-unk továbbra is Vitest 2 nem-triviális kódbázishoz · a watch UX, snapshot, browser mode és `vi` mocking páratlan. bun test akkor jön, ha már Bun-on futsz és egy binary kell install + test + run-ra · gyors, vitest-API-kompatibilis, és egy dev-deppel kevesebb. node:test akkor, ha public npm library-t publikálsz, vagy a környezetedben minden plusz dev-dep harc · unalmas, stabil, és pont annyi feature, amennyi kell.

## Vitest 2 · akkor jó, ha

- Nem-triviális mock, fixture, snapshot igények
- Szép watch UI + Vitest UI kell triázsra
- Komponens / browser-mode tesztek (Vitest browser provider)
- Coverage v8 + custom reporter, amit a cég vár
- Megosztott Vite config dev és test között

## bun test / node:test · akkor jó, ha

- bun test: már Bun-on a projekt, zero dev-dep cél
- bun test: 2-5× gyorsabb cold run kis suite-on kell
- node:test: publikus npm library, dep-allergiás
- node:test: minimal CI image, fut bárhol, ahol Node
- node:test: nem kell fancy mock vagy snapshot

| Szempont | Vitest 2 | bun test / node:test |
| --- | --- | --- |
| Setup költség | Egy dep (`vitest`) + 5 soros config | Nulla · runtime-mal jön |
| Cold-run sebesség (kis suite) | Vitest: ~600-1200ms | bun test: ~100-300ms · node:test: ~300-600ms |
| Watch / HMR | Best-in-class · gráf-alapú parciális rerun | bun test: szolid `--watch` · node:test: `--watch` van, UI nincs |
| Mocking | `vi.mock`, hoisted, batteries-included | bun test: `mock()` vitest-közeli · node:test: `mock` minimal |
| Snapshot | Inline + file, diffeléssel | bun test: van · node:test: csak file, sima |
| Browser / DOM mode | First-class `vitest browser` | Nincs beépítve |
| Cross-runtime | Node, Bun, Deno (compat) | bun test: csak Bun · node:test: csak Node (Bun-on is fut) |
| Mi ajánljuk | Default app-kódra 2026-ban | bun test Bun-native app-ra · node:test library-hoz |

## Amit érdemes elvinni

- Vitest 2 · Nem-triviális mock, fixture, snapshot igények
- Vitest 2 · Szép watch UI + Vitest UI kell triázsra
- Vitest 2 · Komponens / browser-mode tesztek (Vitest browser provider)
- bun test / node:test · bun test: már Bun-on a projekt, zero dev-dep cél
- bun test / node:test · bun test: 2-5× gyorsabb cold run kis suite-on kell
- bun test / node:test · node:test: publikus npm library, dep-allergiás

## Címkék

Vitest 2, bun test / node:test

## Kérdések, amikre válaszol

**Mikor Vitest 2 a jó választás?**

Nem-triviális mock, fixture, snapshot igények Szép watch UI + Vitest UI kell triázsra Komponens / browser-mode tesztek (Vitest browser provider) Coverage v8 + custom reporter, amit a cég vár Megosztott Vite config dev és test között

**Mikor bun test / node:test a jobb választás?**

bun test: már Bun-on a projekt, zero dev-dep cél bun test: 2-5× gyorsabb cold run kis suite-on kell node:test: publikus npm library, dep-allergiás node:test: minimal CI image, fut bárhol, ahol Node node:test: nem kell fancy mock vagy snapshot

## Ezt is megépítjük

https://dfieldsolutions.hu/hu/szolgaltatasok/web-performance

## Több a laborból

- https://dfieldsolutions.hu/hu/labor/ai-search-visibility-checklist.md — Az AI-keresési láthatósági checklista, amit ezen az oldalon futtatunk
- https://dfieldsolutions.hu/hu/labor/eaa-accessibility-deadline.md — Az EU-s akadálymentesítési határidő lejárt — mi él még
- https://dfieldsolutions.hu/hu/labor/web-vitals-playbook.md — Core Web Vitals egy igazi Next.js oldalon
- https://dfieldsolutions.hu/hu/labor/structured-data-aeo.md — Strukturált adat, amit a válaszmotor is tud használni

---

Source: https://dfieldsolutions.hu/hu/labor/vitest-vs-bun-test-vs-node-test-runner
DField Solutions — Torony köz 5-1.a, 2120 Dunakeszi, Hungary — +36 20 722 0002 — dezso@dfieldsolutions.com
Booking: see https://dfieldsolutions.hu/en/contact
