Open the test configuration of almost any front-end project and you’ll find one line that decides more about your CI bill than most of the code around it: environment: 'jsdom'.
Unit and component tests for React, Vue, Angular, Svelte, and Solid apps rarely run in a real browser. They run in Node.js, on top of a JavaScript implementation of the browser’s Document Object Model. Your test renders a button, clicks it, and asserts on the text that appears. The document, the click(), and the text all come from a library that pretends to be a browser.
For most teams that library is jsdom, the long-standing, standards-minded default. A growing number use happy-dom, which is faster but less faithful. Few teams think about the choice again after the first npm install. They should, because the test DOM is often where a component suite spends a large share of its time, and because the two popular options force a trade that most teams don’t know they’re making.

