# Vitest

17 Hacker News commenters recommended Vitest and 8 criticized it, November 2025 to November 2026. It was recommended in 8 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Fast, Jest-compatible test runner built on Vite that people adopt for new projects; the common caveat is trouble with mocks and debugging.

## Why people recommend it

- Jest-compatible test runner on Vite (2 comments): "it's a jest-compatible runner integrated to Vite" ([source](https://news.ycombinator.com/item?id=48762241)) "jest -> vitest (works with vite)" ([source](https://news.ycombinator.com/item?id=48766159))
- Default choice for new projects (2 comments): "I love Vite, Vitest, Oxlint and Oxfmt and look in their direction for most of my new projects!" ([source](https://news.ycombinator.com/item?id=48760812)) "my default choice for new projects" ([source](https://news.ycombinator.com/item?id=48697061))
- Part of the Vite toolchain (3 comments): "I love Vite, Vitest, Oxlint and Oxfmt and look in their direction for most of my new projects!" ([source](https://news.ycombinator.com/item?id=48760812)) "Sure beats opening some ancient project and seeing some mix of Vite, Vitest, Oxlint and Oxfmt" ([source](https://news.ycombinator.com/item?id=48761450)) "VoidZero's tools are all world-class" ([source](https://news.ycombinator.com/item?id=48399571))
- Browser mode for testing (2 comments): "Upgrading to vitest with browser mode can solve these problems" ([source](https://news.ycombinator.com/item?id=47089326)) "yes, i've used vitest browser mode to test canvas operations" ([source](https://news.ycombinator.com/item?id=46431221))

## What people warn about

- Mocks cause trouble and misuse (2 comments): "i have had a lot of trouble with vitest mocks for postgres and redis so far" ([source](https://news.ycombinator.com/item?id=46485205)) "far too easy to call mock() in JS (with Jest/Vitest)" ([source](https://news.ycombinator.com/item?id=48697131))
- Hard to debug or isolate (2 comments): "it's a pain to just "detach" for a specific frame and run that test in isolation" ([source](https://news.ycombinator.com/item?id=46428820)) "Nearly impossible to set breakpoints (they disappear in refresh)" ([source](https://news.ycombinator.com/item?id=46434694))

## Alternatives hackers recommend

- [Mockito](https://hackerapproved.com/p/mockito.md): 19 recommend
- [cargo-nextest](https://hackerapproved.com/p/cargo-nextest.md): 18 recommend
- [Testcontainers](https://hackerapproved.com/p/testcontainers.md): 14 recommend
- [pytest](https://hackerapproved.com/p/pytest.md): 12 recommend
- [Cucumber](https://hackerapproved.com/p/cucumber.md): 9 recommend

## Cite as

Hacker Approved, "Vitest", https://hackerapproved.com/p/vitest/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
