diff --git a/js/tests/vendor/qunit.css b/js/tests/vendor/qunit.css index 6bebe97995..a98504fdf8 100644 --- a/js/tests/vendor/qunit.css +++ b/js/tests/vendor/qunit.css @@ -1,5 +1,5 @@ /** - * QUnit - A JavaScript Unit Testing Framework + * QUnit 1.0.0 - A JavaScript Unit Testing Framework * * http://docs.jquery.com/QUnit * @@ -224,9 +224,3 @@ top: -10000px; left: -10000px; } - -/** Runoff */ - -#qunit-fixture { - display:none; -} diff --git a/js/tests/vendor/qunit.js b/js/tests/vendor/qunit.js index a711c82a86..d411ef48a4 100644 --- a/js/tests/vendor/qunit.js +++ b/js/tests/vendor/qunit.js @@ -1,5 +1,5 @@ /** - * QUnit - A JavaScript Unit Testing Framework + * QUnit 1.0.0 - A JavaScript Unit Testing Framework * * http://docs.jquery.com/QUnit * @@ -48,7 +48,7 @@ Test.prototype = { setup: function() { if (this.module != config.previousModule) { if ( config.previousModule ) { - QUnit.moduleDone( { + runLoggingCallbacks('moduleDone', QUnit, { name: config.previousModule, failed: config.moduleStats.bad, passed: config.moduleStats.all - config.moduleStats.bad, @@ -57,7 +57,7 @@ Test.prototype = { } config.previousModule = this.module; config.moduleStats = { all: 0, bad: 0 }; - QUnit.moduleStart( { + runLoggingCallbacks( 'moduleStart', QUnit, { name: this.module } ); } @@ -71,9 +71,10 @@ Test.prototype = { extend(this.testEnvironment, this.testEnvironmentArg); } - QUnit.testStart( { - name: this.testName - } ); + runLoggingCallbacks( 'testStart', QUnit, { + name: this.testName, + module: this.module + }); // allow utility functions to access the current test environment // TODO why?? @@ -210,8 +211,9 @@ Test.prototype = { fail("reset() failed, following Test " + this.testName + ", exception and reset fn follows", e, QUnit.reset); } - QUnit.testDone( { + runLoggingCallbacks( 'testDone', QUnit, { name: this.testName, + module: this.module, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length @@ -310,8 +312,8 @@ var QUnit = { result: a, message: msg }; - msg = escapeHtml(msg); - QUnit.log(details); + msg = escapeInnerText(msg); + runLoggingCallbacks( 'log', QUnit, details ); config.current.assertions.push({ result: a, message: msg @@ -387,8 +389,8 @@ var QUnit = { QUnit.ok(ok, message); }, - start: function() { - config.semaphore--; + start: function(count) { + config.semaphore -= count || 1; if (config.semaphore > 0) { // don't start until equal number of stop-calls return; @@ -416,20 +418,30 @@ var QUnit = { } }, - stop: function(timeout) { - config.semaphore++; + stop: function(count) { + config.semaphore += count || 1; config.blocking = true; - if ( timeout && defined.setTimeout ) { + if ( config.testTimeout && defined.setTimeout ) { clearTimeout(config.timeout); config.timeout = window.setTimeout(function() { QUnit.ok( false, "Test timed out" ); + config.semaphore = 1; QUnit.start(); - }, timeout); + }, config.testTimeout); } } }; +//We want access to the constructor's prototype +(function() { + function F(){}; + F.prototype = QUnit; + QUnit = new F(); + //Make F QUnit's constructor so that we can add to the prototype later + QUnit.constructor = F; +})(); + // Backwards compatibility, deprecated QUnit.equals = QUnit.equal; QUnit.same = QUnit.deepEqual; @@ -453,7 +465,16 @@ var config = { // by default, modify document.title when suite is done altertitle: true, - urlConfig: ['noglobals', 'notrycatch'] + urlConfig: ['noglobals', 'notrycatch'], + + //logging callback queues + begin: [], + done: [], + log: [], + testStart: [], + testDone: [], + moduleStart: [], + moduleDone: [] }; // Load paramaters @@ -618,10 +639,10 @@ extend(QUnit, { expected: expected }; - message = escapeHtml(message) || (result ? "okay" : "failed"); + message = escapeInnerText(message) || (result ? "okay" : "failed"); message = '
"; - expected = escapeHtml(QUnit.jsDump.parse(expected)); - actual = escapeHtml(QUnit.jsDump.parse(actual)); + expected = escapeInnerText(QUnit.jsDump.parse(expected)); + actual = escapeInnerText(QUnit.jsDump.parse(actual)); var output = message + 'Expected: | ' + expected + ' |
---|---|
Result: | ' + actual + ' |
Source: | ' + escapeHtml(source) + ' |
Source: | ' + escapeInnerText(source) + ' |