src/setupJasmine.js
function findSuiteRec(suite, findFn) {
  if (findFn(suite)) return suite;

  for (const child of suite.children || []) {
    const result = findSuiteRec(child, findFn);

    if (result !== null) {
      return result;
    }
  }

  return null;
}
function findSuiteRec(suite, findFn) {
  if (findFn(suite)) return suite;

  for (const child of suite.children || []) {
    const result = findSuiteRec(child, findFn);

    if (result !== null) {
      return result;
    }
  }

  return null;
}
function findSuiteRec ( suite , findFn ) { if ( findFn ( suite ) ) return suite ; for ( const child of suite . children || [ ] ) { const result = findSuiteRec ( child , findFn ) ; if ( result !== null ) { return result ; } } return null ; }
Recursively go through suite and its children
and return the first that matches the findFn
condition

@param {Object} suite Starting point
@param {Function} findFn Find function

@returns {?Object} Matching suite or null
Recursively go through suite and its children and return the first that matches the findFn condition