Upped QUnit to fix test running under IE

This commit is contained in:
Ryan McGeary 2010-10-26 19:47:24 -04:00
parent 0de35004bc
commit 9ba708c4bd
2 changed files with 21 additions and 19 deletions

View file

@ -10,7 +10,7 @@
/** Resets */ /** Resets */
#qunit-tests, #qunit-tests li ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
@ -68,7 +68,7 @@
cursor: pointer; cursor: pointer;
} }
#qunit-tests li ol { #qunit-tests ol {
margin-top: 0.5em; margin-top: 0.5em;
padding: 0.5em; padding: 0.5em;
@ -83,6 +83,12 @@
-webkit-box-shadow: inset 0px 2px 13px #999; -webkit-box-shadow: inset 0px 2px 13px #999;
} }
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li { #qunit-tests li li {
margin: 0.5em; margin: 0.5em;
padding: 0.4em 0.5em 0.4em 0.5em; padding: 0.4em 0.5em 0.4em 0.5em;
@ -99,13 +105,11 @@
border-left: 26px solid #C6E746; border-left: 26px solid #C6E746;
} }
#qunit-tests li.pass { color: #528CE0; background-color: #D2E0E6; } #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests li.pass span.test-name { color: #366097; } #qunit-tests .pass .test-name { color: #366097; }
#qunit-tests li li.pass span.test-actual, #qunit-tests .pass .test-actual,
#qunit-tests li li.pass span.test-expected { color: #999999; } #qunit-tests .pass .test-expected { color: #999999; }
strong b.pass { color: #5E740B; }
#qunit-banner.qunit-pass { background-color: #C6E746; } #qunit-banner.qunit-pass { background-color: #C6E746; }
@ -117,14 +121,12 @@ strong b.pass { color: #5E740B; }
border-left: 26px solid #EE5757; border-left: 26px solid #EE5757;
} }
#qunit-tests li.fail { color: #000000; background-color: #EE5757; } #qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests li.fail span.test-name, #qunit-tests .fail .test-name,
#qunit-tests li.fail span.module-name { color: #000000; } #qunit-tests .fail .module-name { color: #000000; }
#qunit-tests li li.fail span.test-actual { color: #EE5757; } #qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests li li.fail span.test-expected { color: green; } #qunit-tests .fail .test-expected { color: green; }
strong b.fail { color: #710909; }
#qunit-banner.qunit-fail, #qunit-banner.qunit-fail,
#qunit-testrunner-toolbar { background-color: #EE5757; } #qunit-testrunner-toolbar { background-color: #EE5757; }

View file

@ -131,7 +131,7 @@ var QUnit = {
try { try {
QUnit.reset(); QUnit.reset();
} catch(e) { } catch(e) {
fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, reset); fail("reset() failed, following Test " + name + ", exception and reset fn follows", e, QUnit.reset);
} }
if ( config.expected && config.expected != config.assertions.length ) { if ( config.expected && config.expected != config.assertions.length ) {
@ -168,7 +168,7 @@ var QUnit = {
} }
var b = document.createElement("strong"); var b = document.createElement("strong");
b.innerHTML = name + " <b style='color:black;'>(<b class='fail'>" + bad + "</b>, <b class='pass'>" + good + "</b>, " + config.assertions.length + ")</b>"; b.innerHTML = name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + config.assertions.length + ")</b>";
addEvent(b, "click", function() { addEvent(b, "click", function() {
var next = b.nextSibling, display = next.style.display; var next = b.nextSibling, display = next.style.display;