New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SVGElement? #60
Comments
Try updating jsdom (not jsdom-global) in your project. Hope it helps!
…On Sat, 4 Dec 2021, 9:06 am Joe Rattz, ***@***.***> wrote:
The jsdom package appears to support SVGElement now. Can support for
SVGElement be added to jsdom-global?
Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#60>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAASFEL4CY5T7U4A7S6WSTLUPE5NPANCNFSM5JKW6FKQ>
.
|
Thanks for responding. I am using the latest version of jsdom, 18.1.1, which was released 15 days ago. And jsdom does appear to have support for SVGElement. While non-existent in the source, presumably because it is generated, there is a file named SVGElement.js in node_modules\jsdom\lib\jsdom\living\generated. Not sure what that file gets generated from. It appears to me that the problem is caused by jsdom-global's keys.js file's LIVING_KEYS array missing SVGElement. If I add SVGElement to the array, my error message goes away. Just noticed I didn't provide the error message. The error message is "ReferenceError: SVGElement is not defined" While adding "SVGElement" to the LIVING_KEYS array makes the error message go away, I'm not completely sure that alone is a proper fix because I don't know what all needs to be done for SVGElement to be properly supported. I'm just Forrest Gumping my way through this. I have worked around this by adding the following line of code to a module that gets run for all my tests:
I've seen someone online propose this as a work-around and it does remove the error message but I feel like my work-around is better.
But I'm hoping jsdom-global will be updated to properly support SVGElement by adding the LIVING_KEYS entry and updating anything else needed. Also, if this is done, there's a comment right above the LIVING_KEYS array that is no longer correct. Thanks. |
The jsdom package appears to support SVGElement now. Can support for SVGElement be added to jsdom-global?
Thanks!
The text was updated successfully, but these errors were encountered: