Closed
Description
π
Following the closing of this issue jestjs/jest#13315 (comment), I'm opening one here.
CSSOM is not really maintained anymore and Jest tests are generating a lot of warning in our tests since we now use jest-environment-jsdom.
β Console
console.warn
Warning: [JSS] CSSOM.parse is not a function
53 | const registerScroll = useRegisterScrollElement()
54 |
> 55 | const classes = useAppLayoutStyles({
| ^
56 | innerHeight,
57 | showNavInDesktopOnly: navType === 'desktop-only',
58 | })
Is it possible to switch to something more maintained? (https://github.com/rrweb-io/CSSOM was suggested)
Basic info:
- Node.js version:16.10
- jsdom version: ^20.0.0
Minimal reproduction case
const { JSDOM } = require("jsdom");
const dom = new JSDOM();
const document = dom.window.document;
const styleElement = document.createElement('style');
styleElement.appendChild(document.createTextNode(''));
document.head.appendChild(styleElement);
const sheet = styleElement.sheet;
sheet.insertRule('@media only screen and (orientation: landscape) {}', 0);
// This next line will crash with the error TypeError: CSSOM.parse is not a function
sheet.cssRules[0].insertRule('.elem{background-color: red;}', 0);
How does similar code behave in browsers?
Metadata
Metadata
Assignees
Labels
No labels