happy-dom
happy-dom copied to clipboard
element.getBoundingClientRect().toJSON() does not exist
Describe the bug element.getBoundingClientRect().toJSON() throws as its not implemented.
getBoundingClientRect() returns DOMRect which inherits its properties from DOMRectReadOnly and it has toJSON
method, which is listed in mdn and is supported by all browsers. In my jsdom based tests I was using jsdom-pollyfill
to solve the usecase and the implementaction code it is was using is something like this https://github.com/remirror/remirror/blob/main/packages/jest-remirror/src/jsdom-polyfills.ts#L90-L92 Would you mind PR adding this method?