Update qunit-extras to respect QUnit.config.hidepassed.

This commit is contained in:
John-David Dalton
2014-02-11 23:22:34 -08:00
parent 91bb4d4b00
commit 1ac5fa544b
3 changed files with 19 additions and 11 deletions

View File

@@ -28,7 +28,7 @@
<script> <script>
var lodash = _.noConflict(); var lodash = _.noConflict();
QUnit.config.asyncRetries = 5; QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true; QUnit.config.hidepassed = true;
// excuse tests we intentionally fail or those with problems // excuse tests we intentionally fail or those with problems

View File

@@ -9335,6 +9335,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.config.asyncRetries = 10; QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true;
if (!document) { if (!document) {
QUnit.config.noglobals = true; QUnit.config.noglobals = true;

View File

@@ -408,15 +408,17 @@
} }
ran = true; ran = true;
var failures = details.failed;
logInline(''); logInline('');
console.log(hr); console.log(hr);
console.log(' PASS: ' + details.passed + ' FAIL: ' + details.failed + ' TOTAL: ' + details.total); console.log(' PASS: ' + details.passed + ' FAIL: ' + failures + ' TOTAL: ' + details.total);
console.log(' Finished in ' + details.runtime + ' milliseconds.'); console.log(' Finished in ' + details.runtime + ' milliseconds.');
console.log(hr); console.log(hr);
// exit out of Node.js or PhantomJS // exit out of Node.js or PhantomJS
try { try {
if (details.failed) { if (failures) {
process.exit(1); process.exit(1);
} else { } else {
process.exit(0); process.exit(0);
@@ -425,7 +427,7 @@
// exit out of Narwhal, Rhino, or RingoJS // exit out of Narwhal, Rhino, or RingoJS
try { try {
if (details.failed) { if (failures) {
java.lang.System.exit(1); java.lang.System.exit(1);
} else { } else {
quit(); quit();
@@ -469,10 +471,12 @@
// add a callback to be triggered after a test is completed // add a callback to be triggered after a test is completed
QUnit.testDone(function(details) { QUnit.testDone(function(details) {
var logs = QUnit.config.extrasData.logs, var config = QUnit.config,
failures = details.failed,
logs = config.extrasData.logs,
testName = details.name; testName = details.name;
if (details.failed > 0) { if (!config.hidepassed || failures) {
logInline(''); logInline('');
if (!modulePrinted) { if (!modulePrinted) {
modulePrinted = true; modulePrinted = true;
@@ -480,12 +484,15 @@
console.log(moduleName); console.log(moduleName);
console.log(hr); console.log(hr);
} }
var index = -1, console.log(' ' + (failures ? 'FAIL' : 'PASS') + ' - ' + testName);
length = logs.length;
console.log(' FAIL - ' + testName); if (failures) {
while(++index < length) { var index = -1,
console.log(' ' + logs[index]); length = logs.length;
while(++index < length) {
console.log(' ' + logs[index]);
}
} }
} }
logs.length = 0; logs.length = 0;