Comparison
Headless browservsjsdom
Headless browser
a real browser ran the tests with no window on screen, on a machine with no display at all.
A real browser engine driven programmatically without a visible window, which is what makes end-to-end tests runnable in CI. It gives real layout, real CSS and real timing, unlike a simulated DOM. Small differences between headless and headed mode still exist — fonts, media codecs, some GPU paths — so a failure in one mode and not the other is worth taking seriously rather than dismissing.
Full entry →jsdom
the test ran in Node with a fake DOM and passed, then the feature broke in an actual browser.
A JavaScript implementation of the DOM used to run component tests without a browser. It is fast and good enough for structure and interaction, and it has no layout engine at all — element sizes are zero, no CSS is applied, and anything measuring geometry cannot work. Scroll behaviour, media queries and visual state are exactly the things it cannot tell you about.
Full entry →