@happy-dom/jest-environment
21.0.4 · 20 Oct 2026MIT269.4k / weekRepositoryHomepagenpmAtom feed
711 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 20.x
20.8.1
2 Mar 2026Make "inert" attribute block focus interactions - By @coffeeandwork in task #1422
20.8.0
2 Mar 2026Adds support for setPointerCapture, hasPointerCapture, and releasePointerCapture to Element - By @coffeeandwork in task #1733
20.7.2
2 Mar 2026Properly decode CSS escape sequences in attribute selector values - By @silverwind
20.7.0
21 Feb 2026Adds support for
Window.getScreenDetails()- By @TrevorBurnham in task #1923Extends
ScreenfromEventTarget- By @TrevorBurnham in task #1923
20.6.5
20 Feb 2026Add clearImmediate to Jest environment global scope - By @TrevorBurnham in task #1927
20.6.4
20 Feb 2026Normalize invalid input type attribute to "text" per HTML spec - By @atzzCokeK in task #2053
20.6.3
19 Feb 2026Refactors query selector parser to be able to handle complex rules - By @capricorn86 in task #1910
Fixes issue related to using query selector for attribute in XML document - By @capricorn86 in task #1912
Fixes issue with using quotes within quotes for attribute query selector (e.g.
[data-value="it's a test"]) - By @capricorn86 in task #2034
20.6.2
17 Feb 2026Update entities package version to resolve missing export for vue and vue-compat v3.5 - By @acollins1991 in task #2066
20.6.1
11 Feb 2026Support CSS gradients with
rgba()- By @atzzCokeK in task #2042Support unicode characters in selectors per CSS spec - By @kaigritun in task #2057
20.6.0
9 Feb 2026Adds support for register on import to the
@happy-dom/global-registratorpackage - By @capricorn86 in task #2060
20.5.5
9 Feb 2026Correct caption element content model to allow flow content - By @atzzCokeK in task #2052
20.5.4
9 Feb 2026Implement Text.wholeText property - By @aki05162525 in task #1959
20.5.2
8 Feb 2026Use entities package for HTML/XML encoding and decoding - By @TrevorBurnham in task #1947
20.5.1
8 Feb 2026Fixes logic in
HTMLInputElement.stepUp()andHTMLInputElement.stepDown()to work according to spec - By @stevematney in task #1955
20.5.0
2 Feb 2026Removes circular dependencies internally - By @capricorn86 in task #2055
Changes naming of types used internally to follow a consistent pattern - By @capricorn86 in task #2055
Enforces use of the "type" modifier internally in the source code (e.g.
import typeandexport type) - By @capricorn86 in task #2055
20.4.0
27 Jan 2026Adds support for caching the compiled code of EcmaScript modules - By @capricorn86 in task #2049
Improves the way nodes are destroyed and garbage collected - By @capricorn86 in task #2049
20.3.7
23 Jan 2026Updates README.md for the "@happy-dom/server-renderer" package - By @capricorn86 in task #2035
20.3.4
20 Jan 2026Preserve attribute name case in CSS selectors for XML documents - By @TrevorBurnham in task #1912
Implement implicit closing of
<p>elements per HTML spec - By @TrevorBurnham in task #1949EventTargetshould not call arbitrary on* properties - By @TrevorBurnham in task #1895
20.3.3
18 Jan 2026Add "which" property to
KeyboardEvent- By @TrevorBurnham in task #1897Node.getRootNode()returns correct root for detached shadow trees - By @TrevorBurnham in task #1941Fixes issue that prevented
Node.contains()to work for<select>and<form>elements - By @TrevorBurnham in task #1876
:construction_worker_man: Patch fixes
Add "which" property to
KeyboardEvent- By @TrevorBurnham in task #1897Node.getRootNode()returns correct root for detached shadow trees - By @TrevorBurnham in task #1941Fixes issue that prevented
Node.contains()to work for<select>and<form>elements - By @TrevorBurnham in task #1876Replace
setTimeout()withqueueMicrotask()where appropriate - By @TrevorBurnham in task #1880Optimize
XMLEncodeUtilitywith pre-compiledRegExpand lookup tables - By @TrevorBurnham in task #1983Use
parseFloat()for "Cache-Control" header max-age parsing - By @TrevorBurnham in task #1985Remove redundant
RegExpflags inHTMLParser- By @TrevorBurnham in task #1981Widen "types/node" version range to support Node 24+ - By @TrevorBurnham in task #1966
20.3.2
18 Jan 2026Use
PropertySymbol.bodyto set body incloneBodyStream- By @TrevorBurnham in task #1963Optimize
DOMTokenListadd/remove with Set for O - By @TrevorBurnham in task #1989Allow paths in
WebSocketURLs - By @TrevorBurnham in task #1975
:construction_worker_man: Patch fixes
Use
PropertySymbol.bodyto set body incloneBodyStream- By @TrevorBurnham in task #1963Optimize
DOMTokenListadd/remove with Set for O - By @TrevorBurnham in task #1989Allow paths in
WebSocketURLs - By @TrevorBurnham in task #1975Decode named HTML entities correctly - By @TrevorBurnham in task #1951
20.3.0
14 Jan 2026Use
RegExpto convert ASCII character casing to improve performance - By @TrevorBurnham in task #1886
20.2.0
14 Jan 2026Use
Element.classList.contains()instead of splittingclassNamein query selectors to improve performance as it's cached - By @TrevorBurnham in task #1884
20.1.1
14 Jan 2026Fixes caching in
querySelector()- By @TrevorBurnham in task #1882Avoid sort in
querySelector()to improve performance - By @TrevorBurnham in task #1882
20.1.0
7 Jan 2026Adds support for
BrowserPage.evaluateModule()andBrowserFrame.evaluateModule()- By @capricorn86 in task #1944Adds support for
moduleto the browser settings - By @capricorn86 in task #1944Adds support for dynamic
import()to JavaScript evaluation - By @capricorn86 in task #1944
:art: Features
Adds support for
BrowserPage.evaluateModule()andBrowserFrame.evaluateModule()- By @capricorn86 in task #1944Adds support for
moduleto the browser settings - By @capricorn86 in task #1944This makes it possible to add a custom resolver or a node module resolver
Adds support for dynamic
import()to JavaScript evaluation - By @capricorn86 in task #1944It was previously only supported when using
type="module"on script elements
Adds support for
WebSocket- By @capricorn86 in task #1944Adds support for
CloseEvent- By @capricorn86 in task #1944Adds support for
render.setupScriptandrender.modeto the configuration in @happy-dom/server-renderer - By @capricorn86 in task #1944Changes name from
urlstorenderItemsin the configuration in @happy-dom/server-renderer - By @capricorn86 in task #1944Adds support for rendering HTML strings to
ServerRendererin @happy-dom/server-renderer - By @capricorn86 in task #1944It previously only had support for rendering URLs
This makes it easier to add server-rendering as a hook to frameworks
Makes JavaScript evaluation disabled by default in @happy-dom/server-renderer - By @capricorn86 in task #1944
:construction_worker_man: Patch fixes
Several fixed to the EcmaScript module compiler (esm) - By @capricorn86 in task #1944
Fixes issue where rendering using Worker's didn't work in @happy-dom/server-renderer - By @capricorn86 in task #1944
20.0.11
27 Nov 2025Always include manually set authorization headers in requests - By @capricorn86 in task #1048'
20.0.10
28 Oct 2025Clears event listeners on all nodes when a Window is closed to prevent memory leaks - By @TrevorBurnham in task #1892
20.0.9
28 Oct 2025Elements should only be upgraded to a custom element (web component) when the element is in the document - By @capricorn86 in task #1945
20.0.8
21 Oct 2025Fixes issue where
previousSibling()andnextSibling()didn't work inHTMLSelectElementandHTMLFormElement- By @capricorn86 in task #1939Fixes issue where parsing an item without a permitted parent (e.g.
<tr>) should be valid inside a<template>element - By @capricorn86 in task #1939
20.0.7
19 Oct 2025Fix incorrect handling of
>=operator in media query parser - By @lkritsimas in task #1869
20.0.5
17 Oct 2025The setter
TreeWalker.currentNodeshould validate if the value is aNode- By @capricorn86 in task #1935
20.0.3
16 Oct 2025Moves URL resolution to after checking if module preloading is enabled to prevent URL errors to be thrown when unresolvable - By @iam-medvedev in task #1851
20.0.2
15 Oct 2025Adds frozen intrinsics flag to workers in
@happy-dom/server-renderer- By @capricorn86 in task #1934
20.0.1
14 Oct 2025Adds warning for environment with unfrozen intrinsics (builtins) when JavaScript evaluation is enabled- By @capricorn86 in task #1932
20.0.0
9 Oct 2025- Breaking
Due to security risks, JavaScript evaluation is now disabled by default - By @capricorn86 in task #1930
I avoid making breaking changes as much as possible in Happy DOM. When I have to make a breaking change, I try to keep it as minimal as possible. This could be a breaking change that impacts many projects, and I am truly sorry if you are negatively affected by this.
:bomb: Breaking Changes
- Breaking
Due to security risks, JavaScript evaluation is now disabled by default - By @capricorn86 in task #1930
A security advisory (GHSA-37j7-fg3j-429f) has been reported that shows a security vulnerability where it's possible to escape the VM context and get access to process level functionality. Big thanks to @Mas0nShi for reporting this!
Due to this security risk, JavaScript evaluation is now disabled by default to prevent that consumers accidentally executes untrusted code without taking precautions
JavaScript evaluation can be enabled by setting enableJavaScriptEvaluation to "true". Read more about how to enable this in a safer way in the Wiki
- 19.x
19.0.2
29 Sep 2025Fixes issue related to CSS pseudo selector
:scopethat didn't work correctly for direct descendants to root - By @capricorn86 in task #1620
19.0.1
28 Sep 2025Fixes issue with sending in URLs as string in
@happy-dom/server-rendererconfig using CLI - By @capricorn86 in task #1908
19.0.0
28 Sep 2025- Breaking
Removes support for CommonJS - By @capricorn86 in task #1730
- Breaking
Updates Jest to v30 in the
@happy-dom/jest-environmentpackage - By @capricorn86 in task #1730 - Breaking
Makes Jest packages peer dependencies to make it easier to align versions with the project using
@happy-dom/jest-environment- By @capricorn86 in task #1730
:bomb: Breaking Changes
- Breaking
Removes support for CommonJS - By @capricorn86 in task #1730
Support for CommonJS is no longer needed as Node.js v18 is deprecated and v20 and above supports loading ES modules from CommonJS using
require()
- Breaking
Updates Jest to v30 in the
@happy-dom/jest-environmentpackage - By @capricorn86 in task #1730 - Breaking
Makes Jest packages peer dependencies to make it easier to align versions with the project using
@happy-dom/jest-environment- By @capricorn86 in task #1730
:art: Features
Adds a new package called
@happy-dom/server-renderer- By @capricorn86 in task #1730This package provides a simple way to statically render (SSG) or server-side render (SSR) your client-side application
Read more in the Wiki under Server-Renderer
Adds support for
import.metato the ESM compiler - By @capricorn86 in task #1730Adds support for the CSS pseudo selector
:scope- By @capricorn86 in task #1620Improves support for
MediaList- By @capricorn86 in task #1730Adds support for
CSSKeywordValue,CSSStyleValue,StylePropertyMap,StylePropertyMap,StylePropertyMapReadOnly- By @capricorn86 in task #1730Improves debug information in the ESM compiler - By @capricorn86 in task #1730
Adds validation of browser settings when creating a new
Browserinstance - By @capricorn86 in task #1730Adds support for the browser setting navigation.beforeContentCallback which makes it possible to inject event listeners or logic before content is loaded to the document when navigating a browser frame - By @capricorn86 in task #1730
Adds support for the browser setting fetch.requestHeaders which provides with a declarative and simple way to add request headers - By @capricorn86 in task #1730
Adds support for setting an object to timer.preventTimerLoops which makes it possible to define different settings for
setTimeout()andrequestAnimationFrame()- By @capricorn86 in task #1730Adds support for the browser setting viewport which makes it possible to define a default viewport size - By @capricorn86 in task #1730
Adds support for the parameters
beforeContentCallbackandheaderstoBrowserFrame.goto(),BrowserFrame.goBack(),BrowserFrame.goForward(),BrowserFrame.goSteps()andBrowserFrame.reload()- By @capricorn86 in task #1730Adds support for
PopStateEventand trigger the event when navigating the page history usingHistory.pushState()- By @capricorn86 in task #1730Use local file paths for virtual server files in stack traces - By @capricorn86 in task #1730
Adds support for
ResponseCache.fileSystem.load()andResponseCache.fileSystem.save()for storing and loading cache from the file system - By @capricorn86 in task #1730
:construction_worker_man: Patch fixes
Fixes a bug in the ESM compiler that caused it to fail to parse certain code - By @capricorn86 in task #1730
Disables the same origin policy when navigating a browser frame using
BrowserFrame.goto()- By @capricorn86 in task #1730Fixes bug where CSS selectors with the pseudos "+" and ">" failed for selectors without arguments - By @capricorn86 in task #1730
Adds try and catch to listeners for events dispatched from
XMLHttpRequestto prevent it from being set to an invalid state if a listener throws an Error - By @capricorn86 in task #1730
- 18.x
18.0.1
10 Jun 2025Addresses an issue where an error occurred if the Element ID was set to the same name as a Window property with a null value - By @capricorn86 in task #1841
18.0.0
10 Jun 2025- Breaking
Makes the types for Happy DOM strict - By @capricorn86 in task #1154
- Breaking
BrowserContext.close()now throws an error when trying to close the default context of a browser - By @capricorn86 in task #1154 Adds support for
Browser.closed,BrowserContext.closed,BrowserPage.closedandBrowserFrame.closed- By @capricorn86 in task #1154
:bomb: Breaking Changes
- Breaking
Makes the types for Happy DOM strict - By @capricorn86 in task #1154
This makes it possible to use the option
skipLibCheckset to "false" in the typescript configuration for projects with a strict configurationThis change has resulted in that some types has changed and is therefore considered as a breaking change
- Breaking
BrowserContext.close()now throws an error when trying to close the default context of a browser - By @capricorn86 in task #1154
:art: Features
Adds support for
Browser.closed,BrowserContext.closed,BrowserPage.closedandBrowserFrame.closed- By @capricorn86 in task #1154Adds support for
VirtualConsolePrinter.close()andVirtualConsolePrinter.closed- By @capricorn86 in task #1154Adds support for
CookieContainer.clearCookies()- By @capricorn86 in task #1154
- 17.x
17.6.3
4 Jun 2025Removes global typescript definition that was used for custom elements - By @capricorn86 in task #1154
17.6.2
3 Jun 2025Updates Typescript to the latest version - By @capricorn86 in task #1154
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.