assert-node.js (475B)
1 // |expected| should be an object indicating the expected type of node. 2 function assert_node(actual, expected) 3 { 4 assert_true(actual instanceof expected.type, 5 'Node type mismatch: actual = ' + actual.nodeType + ', expected = ' + expected.nodeType); 6 if (typeof(expected.id) !== 'undefined') 7 assert_equals(actual.id, expected.id); 8 if (typeof(expected.nodeValue) !== 'undefined') 9 assert_equals(actual.nodeValue, expected.nodeValue); 10 }