1 define(['libs/jquery-1.9.1.min', 'libs/chai'], function($, chai) {
3 cleanUp: function(xml) {
4 var rmws = function(node) {
5 if(node.nodeType === 3) {
6 node.data = $.trim(node.data);
9 $(node).contents().each(function() {
21 .replace(/(<.*>)\s*(<.*>)/gm, '$1$2')
22 .replace(/(<\/.*>)\s*(<\/.*>)/gm, '$1$2')
23 .replace(/(<\/.*>)\s*(<.*>)/gm, '$1$2');
24 return $.trim(toret);*/
25 return $('<div>').append(xml).html();
28 assertDomEqual: function(lhs, rhs) {
30 var rhsArr = $.parseHTML(rhs);
31 if(rhsArr.length === 1) {
35 $.each(rhsArr, function(i, el) {
40 lhs = $('<div>').append(lhs);
44 lhs.find('*').each(function() {$(this).attr('id', '');});
45 rhs.find('*').each(function() {$(this).attr('id', '');});
46 return chai.assert.ok(lhs[0].isEqualNode(rhs[0]), 'nodes are equal');