lib/console-runner.js
function suiteFinished(suite, status, results) {
    suite.finished = true;
    suite.status = status;
    suite.duration = new Date() - suite.startTime;
    suite.results = results;
    delete suite.startTime;

    if (suite.index == finishedIndex) {
      for (var i = finishedIndex; i < suites.length; i++) {
        if (suites[i].finished) {
          while(suites[i].queuedTestResults.length) {
            output.testDone(suites[i], suites[i].queuedTestResults.shift());
          }
          output.suiteDone(suites[i]);
        }
        else {
          break;
        }
      }
      finishedIndex = i;
    }

    if (finishedIndex >= suites.length) {
      output.allDone();
    }

    startNextSuite();
  }
function suiteFinished(suite, status, results) {
    suite.finished = true;
    suite.status = status;
    suite.duration = new Date() - suite.startTime;
    suite.results = results;
    delete suite.startTime;

    if (suite.index == finishedIndex) {
      for (var i = finishedIndex; i < suites.length; i++) {
        if (suites[i].finished) {
          while(suites[i].queuedTestResults.length) {
            output.testDone(suites[i], suites[i].queuedTestResults.shift());
          }
          output.suiteDone(suites[i]);
        }
        else {
          break;
        }
      }
      finishedIndex = i;
    }

    if (finishedIndex >= suites.length) {
      output.allDone();
    }

    startNextSuite();
  }
function suiteFinished ( suite , status , results ) { suite . finished = true ; suite . status = status ; suite . duration = new Date ( ) - suite . startTime ; suite . results = results ; delete suite . startTime ; if ( suite . index == finishedIndex ) { for ( var i = finishedIndex ; i < suites . length ; i ++ ) { if ( suites [ i ] . finished ) { while ( suites [ i ] . queuedTestResults . length ) { output . testDone ( suites [ i ] , suites [ i ] . queuedTestResults . shift ( ) ) ; } output . suiteDone ( suites [ i ] ) ; } else { break ; } } finishedIndex = i ; } if ( finishedIndex >= suites . length ) { output . allDone ( ) ; } startNextSuite ( ) ; }
we want to output the suite results in the order they were given to us, so as suties finish we buffer them, and then output them in the right order when we can
we want to output the suite results in the order they were given to us so as suties finish we buffer them and then output them in the right order when we can