From 5c4709882944fbd9800ecaab79d42cb9e3b5d96c Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Mon, 2 May 2011 20:35:18 +0200 Subject: Add simple error handling for domEqual method (was failing for menu, output not helpful). --- tests/unit/testsuite.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 4b273ce78..c1f394ed9 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -75,6 +75,10 @@ window.domEqual = function( selector, modifier, message ) { var attributes = ["class", "role", "id", "tabIndex", "aria-activedescendant"]; function extract(value) { + if (!value || !value.length) { + QUnit.push( false, actual, expected, "domEqual failed, can't extract " + selector + ", message was: " + message ); + return; + } var result = {}; result.nodeName = value[0].nodeName; $.each(attributes, function(index, attr) { -- cgit v1.2.3