The Cost of the DOM: Breaking Down Execution Time in jsdom / happy-dom and Vitest Browser Mode
SessionTrack CJapanese
Slides
Should component tests run in jsdom or happy-dom, or in a real browser? Pure functions and hooks do not need a DOM, but components are visual and a real browser is useful for validating behavior and design. Vitest Browser Mode and the Storybook Vitest Addon have made browser component testing more accessible, yet real-browser tests are still generally perceived as slow, so non-visual tests are commonly divided between jsdom/happy-dom and browser setups.
This session runs the same tests through Vitest with jsdom and through setups such as Storybook Vitest Addon, measuring environment startup, code transformation, module loading, test execution, and parallelization. It replaces the vague impression that “browsers are slow” with a concrete cost breakdown and examines whether teams can avoid maintaining separate test environments.

ypresto
Joined MIXI as a new graduate in 2012 and helped launch Mitene from 2014, primarily working on Android development. Later joined several startups in education and retail, taking on broad development responsibilities and leading frontend and UI design. Joined LayerX in January 2024, where he works on product development and frontend platform improvements in the Bakuraku division. Investigated TypeScript's performance, resulting in a merged pull request to improve it. Aspires to become a type wizard.
