JSConf JP

The Cost of the DOM: Breaking Down Execution Time in jsdom / happy-dom and Vitest Browser Mode

SessionTrack CJapanese

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.