app/util.js
/** Function: gatherDescriptions
 * Traverses the parent suites of a test spec recursivly and gathers all
 * descriptions. Finally returns them as an array.
 *
 * Example:
 * If your test file has the following structure, this function returns an
 * array like ['My Tests', 'Module 1', 'Case A'] when executed for `Case A`:
 *
 *     describe('My Tests', function() {
 *         describe('Module 1', function() {
 *             it('Case A', function() { /* ... * / });
 *         });
 *     });
 *
 * Parameters:
 *     (Object) suite - Test suite
 *     (Array) soFar - Already gathered descriptions. On first call, pass an
 *                     array containing the specs description itself.
 *
 * Returns:
 *     (Array) containing the descriptions of all parental suites and the suite
 *             itself.
 */
gatherDescriptions
Traverses the parent suites of a test spec recursivly and gathers all
descriptions. Finally returns them as an array.





(Object) suite - Test suite
(Array) soFar - Already gathered descriptions. On first call, pass an
array containing the specs description itself.

(Array) containing the descriptions of all parental suites and the suite
itself.
gatherDescriptions Traverses the parent suites of a test spec recursivly and gathers all descriptions . Finally returns them as an array . ( Object ) suite - Test suite ( Array ) soFar - Already gathered descriptions . On first call pass an array containing the specs description itself . ( Array ) containing the descriptions of all parental suites and the suite itself .
function gatherDescriptions(suite, soFar) {
    if (suite.description != null) { soFar.push(suite.description) };
    if(suite.parentSuite) {
        return gatherDescriptions(suite.parentSuite, soFar);
    } else {
        return soFar;
    }
}
function gatherDescriptions ( suite , soFar ) { if ( suite . description != null ) { soFar . push ( suite . description ) } ; if ( suite . parentSuite ) { return gatherDescriptions ( suite . parentSuite , soFar ) ; } else { return soFar ; } }
Function: gatherDescriptions
 Traverses the parent suites of a test spec recursivly and gathers all
 descriptions.
Function : gatherDescriptions Traverses the parent suites of a test spec recursivly and gathers all descriptions .