When I try to run this code in jasmine.js test
document.createElement(tag);
I get this error
ReferenceError: document is not defined
I understand, the document
object is not available in jasmine.js tests, but how can I dynamically create a new HTML element?