Basic info:
- Node.js version: n/a
- jsdom version: any version is affected
Minimal reproduction case
const div = document.createElement('div');
document.body.appendChild(div);
console.time('getComputedStyle');
getComputedStyle(div);
console.timeEnd('getComputedStyle');
How does similar code behave in browsers?
This code take a fraction of millisecond in real browsers, but 100 times slower in JSDOM. There are some libraries in the ecosystem heavily relying on this API and the tests become slow because of that.
Related issues:
testing-library/dom-testing-library#820
theKashey/react-focus-lock#151
Basic info:
Minimal reproduction case
How does similar code behave in browsers?
This code take a fraction of millisecond in real browsers, but 100 times slower in JSDOM. There are some libraries in the ecosystem heavily relying on this API and the tests become slow because of that.
Related issues:
testing-library/dom-testing-library#820
theKashey/react-focus-lock#151