Description
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It gives code that expects a browser, such as DOM manipulation, custom elements and fetch calls, a working document model inside Node.js or Bun, without opening a window. The project lists DOM features including Web Components with custom elements, declarative shadow DOM, MutationObserver, TreeWalker and the Fetch API. It can be set up as a test environment, so component and unit tests can render and query markup without launching a real browser. The documentation has a getting started guide and a separate page for the test setup. The listed integrations include Vitest, Bun, Jest, Testing Library, Google LitElement, Vue, React, Svelte and Angular. It is released under the MIT licence, with copyright from 2019 to the present, and it accepts contributions through a contributing guide on GitHub.…
Highlights
- Browser DOM APIs in Node.js and Bun with no GUI
- Custom elements and declarative shadow DOM
- MutationObserver, TreeWalker and the Fetch API
- Works with Vitest, Jest, Testing Library and major frameworks
Ratings & Reviews
No ratings yet
Be the first to rate Happy Dom.
People also visit

Testing Playground
Simple and complete DOM testing playground that encourage good testing practices
Happy Dom FAQ
What is Happy DOM?
Happy DOM is a JavaScript implementation of a web browser's document model, without a graphical interface. It runs in Node.js and Bun so code and tests that expect a browser can run without one.
What is it used for?
Running browser-style code and tests without a browser window. The listed uses include manipulating the DOM, rendering Web Components and making fetch requests in a server-side environment.
How do I start?
Follow the getting started guide in the project documentation. There is a separate page for setting it up as a test environment.
Which test tools does it work with?
The project lists Vitest, Bun, Jest and Testing Library, and it works with React, Vue, Svelte, Angular and Google LitElement.
Is it free?
Yes. It is MIT licensed and the source is public on GitHub.
Does it open a browser window?
No. It is a browser without its graphical user interface, so it does not draw a window or page layout.
Who maintains it?
The licence names David Ortner as copyright holder from 2019 to the present. Contributions are taken through the contributing guide in the GitHub repository.
What are the best Happy Dom alternatives?
Popular alternatives to Happy Dom include Testing Playground, Browser Run and Playwright. See all Happy Dom alternatives








