I fail to get the computed style value of color with jsdom:
require("jsdom").env({
html: '<html><head><style> html { color: red; } </style></head><body></body></html>',
done: function(errors, window) {
console.log('color: "'+window.getComputedStyle(window.document.body).color+'"');
}
});
The previous test returns "" instead of "rgb(255, 0, 0)" or "red" ...
(note that this work properly in a browser)
Do I miss something ?
It seems like jsdom does not implement inheritance for getComputedStyle.
If you get the computed style of the html tag it should work however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With