diff --git a/tests/xml_eq.js b/tests/xml_eq.js index c330979945..47084cd858 100644 --- a/tests/xml_eq.js +++ b/tests/xml_eq.js @@ -97,10 +97,13 @@ * Parameters: * got - {DOMElement} * expected - {DOMElement} - * options - {Object} Optional object for configuring test options. Set - * 'prefix' property to true in order to compare element and attribute - * prefixes (namespace uri always tested). By default, prefixes - * are not tested. + * options - {Object} Optional object for configuring test options. + * + * Valid options: + * prefix - {Boolean} Compare element and attribute + * prefixes (namespace uri always tested). Default is false. + * includeWhiteSpace - {Boolean} Include whitespace only nodes when + * comparing child nodes. Default is false. */ function assertElementNodesEqual(got, expected, options) { var testPrefix = (options && options.prefix === true); @@ -190,14 +193,17 @@ } // compare children + var gotChildNodes = getChildNodes(got, options); + var expChildNodes = getChildNodes(expected, options); + assertEqual( - got.childNodes.length, expected.childNodes.length, + gotChildNodes.length, expChildNodes.length, "Children length mismatch for " + got.nodeName ); - for(var j=0; j