lib/jaribu.js
function pass(part, suiteIndex, testIndex) {
    var o;
    var isSuite = false;

    if (typeof testIndex === 'number') {
      o = suites[suiteIndex].tests[testIndex];
    } else {
      isSuite = true;
      o = suites[suiteIndex];
    }

    display.pass(part, o);

    if ( isSuite ) {  // Suite ----------------------------
      if (part === 'setup') {  // setup completed
        o.setup.status = true;
        // run the next test in suite
        if (!testIndex) {
          testIndex = 0;
        } else {
          testIndex = testIndex + 1;
        }

        if (typeof o.tests[testIndex] === 'object') {
          run('beforeEach', suiteIndex, testIndex);
        } else {
          run('takedown', suiteIndex);
        }
      } else if (part === 'takedown') {  // takedown completed
        o.takedown.status = true;
        if (o.next) {
          // move on to the next suite
          run('setup', suiteIndex + 1);
        } else {
          // finished, show summary results
          showSummary();
        }
      }
    } else {  // Test ----------------------------------------------
      if (part === 'beforeEach') {  // beforeEach completed
        o.beforeEach.status = true;
        // run the test setup
        run('setup', suiteIndex, testIndex);
      } else if (part === 'setup') {  // setup completed
        o.setup.status = true;
        // run the test
        run('actual', suiteIndex, testIndex);
      } else if (part === 'takedown') {  // takedown completed
        o.takedown.status = true;
        // call afterEach
        run('afterEach', suiteIndex, testIndex);
      } else if (part === 'afterEach') {  // afterEach completed
        o.afterEach.status = true;
        if (typeof o.parent.tests[testIndex + 1] === 'object') {
          o.parent.testIndex = testIndex + 1;
          run('beforeEach', suiteIndex, testIndex + 1);
        } else {
          // run suites takedown
          run('takedown', suiteIndex);
        }
      } else {
        // test is complete
        o.status = true;
        run('takedown', suiteIndex, testIndex);
      }
    }
  }
function pass(part, suiteIndex, testIndex) {
    var o;
    var isSuite = false;

    if (typeof testIndex === 'number') {
      o = suites[suiteIndex].tests[testIndex];
    } else {
      isSuite = true;
      o = suites[suiteIndex];
    }

    display.pass(part, o);

    if ( isSuite ) {  // Suite ----------------------------
      if (part === 'setup') {  // setup completed
        o.setup.status = true;
        // run the next test in suite
        if (!testIndex) {
          testIndex = 0;
        } else {
          testIndex = testIndex + 1;
        }

        if (typeof o.tests[testIndex] === 'object') {
          run('beforeEach', suiteIndex, testIndex);
        } else {
          run('takedown', suiteIndex);
        }
      } else if (part === 'takedown') {  // takedown completed
        o.takedown.status = true;
        if (o.next) {
          // move on to the next suite
          run('setup', suiteIndex + 1);
        } else {
          // finished, show summary results
          showSummary();
        }
      }
    } else {  // Test ----------------------------------------------
      if (part === 'beforeEach') {  // beforeEach completed
        o.beforeEach.status = true;
        // run the test setup
        run('setup', suiteIndex, testIndex);
      } else if (part === 'setup') {  // setup completed
        o.setup.status = true;
        // run the test
        run('actual', suiteIndex, testIndex);
      } else if (part === 'takedown') {  // takedown completed
        o.takedown.status = true;
        // call afterEach
        run('afterEach', suiteIndex, testIndex);
      } else if (part === 'afterEach') {  // afterEach completed
        o.afterEach.status = true;
        if (typeof o.parent.tests[testIndex + 1] === 'object') {
          o.parent.testIndex = testIndex + 1;
          run('beforeEach', suiteIndex, testIndex + 1);
        } else {
          // run suites takedown
          run('takedown', suiteIndex);
        }
      } else {
        // test is complete
        o.status = true;
        run('takedown', suiteIndex, testIndex);
      }
    }
  }
function pass ( part , suiteIndex , testIndex ) { var o ; var isSuite = false ; if ( typeof testIndex === 'number' ) { o = suites [ suiteIndex ] . tests [ testIndex ] ; } else { isSuite = true ; o = suites [ suiteIndex ] ; } display . pass ( part , o ) ; if ( isSuite ) { // Suite ---------------------------- if ( part === 'setup' ) { // setup completed o . setup . status = true ; // run the next test in suite if ( ! testIndex ) { testIndex = 0 ; } else { testIndex = testIndex + 1 ; } if ( typeof o . tests [ testIndex ] === 'object' ) { run ( 'beforeEach' , suiteIndex , testIndex ) ; } else { run ( 'takedown' , suiteIndex ) ; } } else if ( part === 'takedown' ) { // takedown completed o . takedown . status = true ; if ( o . next ) { // move on to the next suite run ( 'setup' , suiteIndex + 1 ) ; } else { // finished, show summary results showSummary ( ) ; } } } else { // Test ---------------------------------------------- if ( part === 'beforeEach' ) { // beforeEach completed o . beforeEach . status = true ; // run the test setup run ( 'setup' , suiteIndex , testIndex ) ; } else if ( part === 'setup' ) { // setup completed o . setup . status = true ; // run the test run ( 'actual' , suiteIndex , testIndex ) ; } else if ( part === 'takedown' ) { // takedown completed o . takedown . status = true ; // call afterEach run ( 'afterEach' , suiteIndex , testIndex ) ; } else if ( part === 'afterEach' ) { // afterEach completed o . afterEach . status = true ; if ( typeof o . parent . tests [ testIndex + 1 ] === 'object' ) { o . parent . testIndex = testIndex + 1 ; run ( 'beforeEach' , suiteIndex , testIndex + 1 ) ; } else { // run suites takedown run ( 'takedown' , suiteIndex ) ; } } else { // test is complete o . status = true ; run ( 'takedown' , suiteIndex , testIndex ) ; } } }
test object is passed here when it passes the test, setup or takedown.
handles printing the result, and updating the objects status.

@param  {string}  part       - indicates the portion of test just run
@param  {number}  suiteIndex - the index number of the test run
@param  {number}  testIndex  - the index number of the test run [optional]
test object is passed here when it passes the test setup or takedown . handles printing the result and updating the objects status .