Skip to content

Commit 5c47098

Browse files
committed
Add simple error handling for domEqual method (was failing for menu, output not helpful).
1 parent 0496a50 commit 5c47098

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/unit/testsuite.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ window.domEqual = function( selector, modifier, message ) {
7575
var attributes = ["class", "role", "id", "tabIndex", "aria-activedescendant"];
7676

7777
function extract(value) {
78+
if (!value || !value.length) {
79+
QUnit.push( false, actual, expected, "domEqual failed, can't extract " + selector + ", message was: " + message );
80+
return;
81+
}
7882
var result = {};
7983
result.nodeName = value[0].nodeName;
8084
$.each(attributes, function(index, attr) {

0 commit comments

Comments
 (0)