lib/_patch/jasmine-jsreporter.js
function getSuiteData (suite) {
        var suiteData = {
                description : suite.description,
                durationSec : 0,
                specs: [],
                suites: [],
                passed: true
            },
            specs = suite.specs(),
            suites = suite.suites(),
            i, ilen;

        // Loop over all the Suite's Specs
        for (i = 0, ilen = specs.length; i < ilen; ++i) {
            suiteData.specs[i] = {
                description : specs[i].description,
                durationSec : specs[i].durationSec,
                passed : specs[i].results().passedCount === specs[i].results().totalCount,
                results : specs[i].results()
            };
            suiteData.passed = !suiteData.specs[i].passed ? false : suiteData.passed;
            suiteData.durationSec += suiteData.specs[i].durationSec;
        }

        // Loop over all the Suite's sub-Suites
        for (i = 0, ilen = suites.length; i < ilen; ++i) {
            suiteData.suites[i] = getSuiteData(suites[i]); //< recursive population
            suiteData.passed = !suiteData.suites[i].passed ? false : suiteData.passed;
            suiteData.durationSec += suiteData.suites[i].durationSec;
        }

        // Rounding duration numbers to 3 decimal digits
        suiteData.durationSec = round(suiteData.durationSec, 4);

        return suiteData;
    }
function getSuiteData (suite) {
        var suiteData = {
                description : suite.description,
                durationSec : 0,
                specs: [],
                suites: [],
                passed: true
            },
            specs = suite.specs(),
            suites = suite.suites(),
            i, ilen;

        // Loop over all the Suite's Specs
        for (i = 0, ilen = specs.length; i < ilen; ++i) {
            suiteData.specs[i] = {
                description : specs[i].description,
                durationSec : specs[i].durationSec,
                passed : specs[i].results().passedCount === specs[i].results().totalCount,
                results : specs[i].results()
            };
            suiteData.passed = !suiteData.specs[i].passed ? false : suiteData.passed;
            suiteData.durationSec += suiteData.specs[i].durationSec;
        }

        // Loop over all the Suite's sub-Suites
        for (i = 0, ilen = suites.length; i < ilen; ++i) {
            suiteData.suites[i] = getSuiteData(suites[i]); //< recursive population
            suiteData.passed = !suiteData.suites[i].passed ? false : suiteData.passed;
            suiteData.durationSec += suiteData.suites[i].durationSec;
        }

        // Rounding duration numbers to 3 decimal digits
        suiteData.durationSec = round(suiteData.durationSec, 4);

        return suiteData;
    }
function getSuiteData ( suite ) { var suiteData = { description : suite . description , durationSec : 0 , specs : [ ] , suites : [ ] , passed : true } , specs = suite . specs ( ) , suites = suite . suites ( ) , i , ilen ; // Loop over all the Suite's Specs for ( i = 0 , ilen = specs . length ; i < ilen ; ++ i ) { suiteData . specs [ i ] = { description : specs [ i ] . description , durationSec : specs [ i ] . durationSec , passed : specs [ i ] . results ( ) . passedCount === specs [ i ] . results ( ) . totalCount , results : specs [ i ] . results ( ) } ; suiteData . passed = ! suiteData . specs [ i ] . passed ? false : suiteData . passed ; suiteData . durationSec += suiteData . specs [ i ] . durationSec ; } // Loop over all the Suite's sub-Suites for ( i = 0 , ilen = suites . length ; i < ilen ; ++ i ) { suiteData . suites [ i ] = getSuiteData ( suites [ i ] ) ; //< recursive population suiteData . passed = ! suiteData . suites [ i ] . passed ? false : suiteData . passed ; suiteData . durationSec += suiteData . suites [ i ] . durationSec ; } // Rounding duration numbers to 3 decimal digits suiteData . durationSec = round ( suiteData . durationSec , 4 ) ; return suiteData ; }
Collect information about a Suite, recursively, and return a JSON result.
@param suite The Jasmine Suite to get data from
Collect information about a Suite recursively and return a JSON result .