jsdom not support svg?

Viewed 4227

I download jsdom@11.0.0 to make my react project test easier。 But I find the jsdom can not create svg element。
code follows:

const dc = (new JSDOM(`...`)).window.document;
var svg = dc.createElementNS("http://www.w3.org/2000/svg", "svg");
var div = dc.createElement("div");
var svg2 = dc.createElement("svg");
console.log("svg:", svg, svg.createSVGPoint);
console.log("div:", div);
console.log("svg2:", svg2, svg2.createSVGPoint);

and the result is :

svg: HTMLUnknownElement {} undefined
div: HTMLDivElement {}
svg2: HTMLUnknownElement {} undefined

I want to do some test in my code, but svg is not work。
I need help。 Thank you very much!

1 Answers
Related