# Testing a Page with jsdom

jsdom is a browser without a screen that runs inside your tests, so Vitest can build a little page, click its buttons with dispatchEvent and check what the page says, in a moment and without opening a browser.

![Cheat sheet: Testing a Page with jsdom](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/10/5ab9c947ea25442a9b83fd3cacacff2e.webp)

- Category: JavaScript
- Level: Freelancer
- Tags: DOM, Event (javascript), JavaScript, jsdom, Setup and Teardown, textContent, unit testing
- Updated: November 1, 2026

Source: https://www.ask-codey.com/cheat-sheets/javascript-testing-the-dom-cheat-sheet
