Node.js version
22.15.0
jsdom version
27.0.1
Minimal reproduction case
const { JSDOM, VirtualConsole } = require("jsdom");
const { window } = new JSDOM(undefined, {
virtualConsole: new VirtualConsole(),
});
const { document } = window;
const div = document.createElement("div");
document.body.appendChild(div);
div.style.setProperty("border", "2px solid gray");
console.log(window.getComputedStyle(div).getPropertyValue("border"));
How does similar code behave in browsers?
https://jsfiddle.net/24qcL9nd/
Linked JSFiddle in both Firefox and Chrome returns "2px solid rgb(128, 128, 128)".
What is the problem?
Expected to see "2px solid rgb(128, 128, 128)" as the output, instead jsdom returns an empty string.
SIDENOTE: jsdom 26.1.0 returned "2px solid gray" instead, which while still incorrect was at least something.
Node.js version
22.15.0
jsdom version
27.0.1
Minimal reproduction case
How does similar code behave in browsers?
https://jsfiddle.net/24qcL9nd/
Linked JSFiddle in both Firefox and Chrome returns
"2px solid rgb(128, 128, 128)".What is the problem?
Expected to see
"2px solid rgb(128, 128, 128)"as the output, instead jsdom returns an empty string.SIDENOTE: jsdom 26.1.0 returned
"2px solid gray"instead, which while still incorrect was at least something.