December 29, 2025

Tests in the browser? Hold my cookies

Vitest Browser Mode Guide

Real browser tests arrive—hype vs headaches over CI and debugging

TLDR: Vitest’s Browser Mode is now stable, bringing real‑browser component tests and screenshots. Commenters are excited but divided: some love the realism, others gripe that CI still needs Playwright/WebdriverIO and that debugging feels clunky, while speed claims get the classic “show me numbers” challenge—important because this could reshape frontend testing.

Vitest just made its Browser Mode officially stable with v4, promising real browser component tests, visual previews, and built‑in screenshots. The blog calls it fast and predicts it’ll be standard by 2027, but the comments turned into a tech soap opera. One camp’s cheering, the other’s muttering “who’s paying for the snacks?” The biggest spark: CI still needs Playwright or WebdriverIO, as pointed out by gwynforthewyn, who says the docs recommend switching away from the default preview for serious runs. Translation for non‑devs: the shiny new car still borrows an engine from the old one. Old‑school nostalgia hit hard when syspec missed Karma’s easy breakpoint debugging, complaining that Browser Mode makes isolating a failing test feel clunky. Meanwhile, throw2312321 asked the crowd‑favorite question: can it test canvas and screenshot it? (The feature list screams “yes,” but folks want receipts.) And then c_s_guy lobbed the classic grenade: “What makes it fast?”—demanding benchmarks over buzzwords. The vibe? Excited but side‑eyeing the fine print. The memes practically write themselves: “Hold my cookies,” “Stop mocking me,” and “If it’s real, show me frames.” Dive into the docs and pick a side.

Key Points

  • Vitest Browser Mode enables component-level tests to run in real browsers such as Chrome and Firefox.
  • It offers visual previews, fast execution, and built-in visual regression screenshot capabilities.
  • Browser Mode supports native Web APIs (e.g., storage, fetch, observers, clipboard, geolocation, web workers) without mocking.
  • It differs from E2E frameworks like Playwright/Cypress by focusing on isolated component testing rather than full pages.
  • Vitest v4 (released last month, relative to late Nov 2025) marked Browser Mode as stable and supports headless and CI execution.

Hottest takes

"to run tests in CI you need to install either playwright or webdriverio." — gwynforthewyn
"it’s a pain to just ‘detach’ for a specific frame and run that test in isolation, with my actual breakpoints" — syspec
"What makes it fast?" — c_s_guy
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.