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-color", "gray");
console.log(window.getComputedStyle(div).getPropertyValue("border-color"));
How does similar code behave in browsers?
https://jsfiddle.net/s5dL1n93/
Chrome and Firefox outputs "rgb(128, 128, 128)".
What is the problem?
jsdom outputs "rgb(128, 128, 128) rgb(128, 128, 128) rgb(128, 128, 128)" instead.
Node.js version
22.15.0
jsdom version
27.0.1
Minimal reproduction case
How does similar code behave in browsers?
https://jsfiddle.net/s5dL1n93/
Chrome and Firefox outputs
"rgb(128, 128, 128)".What is the problem?
jsdom outputs
"rgb(128, 128, 128) rgb(128, 128, 128) rgb(128, 128, 128)"instead.