I am trying to write a UI test for a HTML component using Jasmine and jsdom.
In my component I am using createTextNode to generate the content of the DOM element.
However when the test runs the document.createTextNode is returning an empty object
let dom = new JSDOM("<!doctype html><html><body></body></html>");
global.window = dom.window;
global.document = dom.window.document;
global.navigator = global.window.navigator;
let div = document.createElement("div");
let content = document.createTextNode("hello");
console.log(content); // Text {}
div.appendChild(content);
console.log(div.innerText) // undefined