Concept: jsdom Environment
Question
What does the jsdom test environment provide?
Hint
It's a 'fake' DOM — not a real browser.
Explanation
jsdom is a pure-JavaScript implementation of the DOM and HTML standards that runs in Node.js. It simulates a browser environment (document, window, elements) without launching a real browser. This lets you test DOM-manipulating code in Node.js quickly. It doesn't support layout/rendering or all browser APIs — for those, you need a real browser (e.g., via Playwright or Cypress).
Related Resources
Related Lessons
- DOM Testing
Testing DOM manipulation.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.