We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dacacce commit 4be4622Copy full SHA for 4be4622
test/utils/initMatchers.js
@@ -104,7 +104,12 @@ chai.use((chaiAPI, utils) => {
104
* @returns {CSSStyleDeclaration}
105
*/
106
function pretendVisibleGetComputedStyle(element) {
107
- const declaration = new CSSStyleDeclaration();
+ // `CSSStyleDeclaration` is not constructable
108
+ // https://stackoverflow.com/a/52732909/3406963
109
+ // this is not equivalent to the declaration from `getComputedStyle`
110
+ // e.g `getComputedStyle` would return a readonly declaration
111
+ // let's hope this doesn't get passed around until it's no longer clear where it comes from
112
+ const declaration = document.createElement('span').style;
113
114
// initial values
115
declaration.content = '';
0 commit comments