Suppose I have a function
function f_createScriptElement(f_url) {
var script = d[CreateElement](Script);
script.type = "text/javascript";
script[Src] = f_url;
script.async = true;
try {
var container = ((m_videoPlayerTagId) ? d[GetElementById](m_videoPlayerTagId) : f_getAdContainerElem());
if (container) {
container.addEventListener("loadedmetadata", function(e) {
var c_width = this.videoWidth,
c_height = this.videoHeight,
v_width = this[WIDTH],
v_height = this[HEIGHT];
m_playerProperties[NS_AD_CD] = container.duration;
m_playerProperties[NS_AD_SZ] = c_width + "x" + c_height;
m_playerProperties[NS_AD_PS] = v_width + "x" + v_height;
m_playerProperties[NS_AD_VS] = ((container.volume === 0) ? false : true);
}, false);
container.parentNode.insertBefore(script, container.nextSibling);
} else {
return;
}
} catch (err) {}
}
It would be great if you could tell the appropriate test cases you would write(Both Positive and Negative) to have complete code coverage for this function in QUnit since it doesnt return a string or a number.