lib/karma-parallelizer.js
function wrap(fn, isFocus, isDescription, isSpec) {
    if (!fn) return fn;
    return function(name, def) {
      if (isDescription && depth === 0) {
        // Reset isFaking on top-level descriptions
        isFaking = !shouldUseDescription(name, def);
      }

      hasOwnSpecs = hasOwnSpecs || (isSpec && !isFaking);
      hasOtherSpecs = hasOtherSpecs || (isSpec && isFaking);
      hasFocusedWhileFaking = hasFocusedWhileFaking || (isFocus && isFaking);
      hasFocusedWithoutFaking =
        hasFocusedWithoutFaking || (isFocus && !isFaking);

      if (isDescription) def = wrapDescription(def);

      if (!isFaking || forceDescribe) {
        // Call through to framework and return the result
        return fn.call(this, name, def);
      } else if (isDescription) {
        // If its a fake description, then we need to call through to eval inner its() looking for focuses
        // TODO, do we ever need parameters?
        def();
      }
    };
  }
function wrap(fn, isFocus, isDescription, isSpec) {
    if (!fn) return fn;
    return function(name, def) {
      if (isDescription && depth === 0) {
        // Reset isFaking on top-level descriptions
        isFaking = !shouldUseDescription(name, def);
      }

      hasOwnSpecs = hasOwnSpecs || (isSpec && !isFaking);
      hasOtherSpecs = hasOtherSpecs || (isSpec && isFaking);
      hasFocusedWhileFaking = hasFocusedWhileFaking || (isFocus && isFaking);
      hasFocusedWithoutFaking =
        hasFocusedWithoutFaking || (isFocus && !isFaking);

      if (isDescription) def = wrapDescription(def);

      if (!isFaking || forceDescribe) {
        // Call through to framework and return the result
        return fn.call(this, name, def);
      } else if (isDescription) {
        // If its a fake description, then we need to call through to eval inner its() looking for focuses
        // TODO, do we ever need parameters?
        def();
      }
    };
  }
function wrap ( fn , isFocus , isDescription , isSpec ) { if ( ! fn ) return fn ; return function ( name , def ) { if ( isDescription && depth === 0 ) { // Reset isFaking on top-level descriptions isFaking = ! shouldUseDescription ( name , def ) ; } hasOwnSpecs = hasOwnSpecs || ( isSpec && ! isFaking ) ; hasOtherSpecs = hasOtherSpecs || ( isSpec && isFaking ) ; hasFocusedWhileFaking = hasFocusedWhileFaking || ( isFocus && isFaking ) ; hasFocusedWithoutFaking = hasFocusedWithoutFaking || ( isFocus && ! isFaking ) ; if ( isDescription ) def = wrapDescription ( def ) ; if ( ! isFaking || forceDescribe ) { // Call through to framework and return the result return fn . call ( this , name , def ) ; } else if ( isDescription ) { // If its a fake description, then we need to call through to eval inner its() looking for focuses // TODO, do we ever need parameters? def ( ) ; } } ; }
On focus spec in mocha we need to return the test result and need to
On focus spec in mocha we need to return the test result and need to