Wraps a group of tests with setUp and tearDown functions.
Used by testCase.

@param {Function} setUp
@param {Function} tearDown
@param {Object} group
@api private
8086
function (setUp, tearDown, group) {
    var tests = {};
    var keys = _keys(group);
    for (var i = 0; i < keys.length; i += 1) {
        var k = keys[i];
        if (typeof group[k] === 'function') {
            tests[k] = wrapTest(setUp, tearDown, group[k]);
        }
        else if (typeof group[k] === 'object') {
            tests[k] = wrapGroup(setUp, tearDown, group[k]);
        }
    }
    return tests;
}
419619
function coverage() {
  var jscoverage = spawn(bin('jscoverage'), ['lib', 'lib-cov']);

  jscoverage.on('error', function(err) {
    console.error(err);
    process.exit(1);
  });

  jscoverage.stderr.setEncoding('utf8');
  jscoverage.stderr.on('data', function(err) {
    console.error(err);
    process.exit(1);
  });

  jscoverage.on('close', suite);
}
18729
public static void setGroup(FileSystem fs, Path path, String group) throws IOException {
    fs.setOwner(path, fs.getFileStatus(path).getOwner(), group);
  }
1331686
public void removeGroup(String group) {

        if (m_fieldsByGroup.get(group) != null) {
            List<I_CmsFormField> fieldsToRemove = new ArrayList<I_CmsFormField>(m_fieldsByGroup.get(group));
            for (I_CmsFormField field : fieldsToRemove) {
                removeField(field);
            }
        }
        m_fieldsByGroup.removeAll(group);
    }
1035587
function (title) {
    Suite.super_.call(this)

    this.title = title
    this.suites = []
    this.exclusivity = Suite.EXCLUSIVITY.NONE
    this.testExclusivity = undefined
    this.parent = undefined
    this.nextTests = []
    this.globalTests = []
    this.testContainer = false
    this.testDependencies = []

    this.hasOnlyTest = false

    this._only = false
    this._skip = false
    this._timeout = undefined
    this._prepared = false
    this._nonExclusives = []
    this._context = undefined

    this.tests = {
        beforeAll: []
      , beforeEach: []
      , normal: []
      , afterEach: []
      , afterAll: []
    }
}
897380
def teardown(exceptions=[])
      stop

      (vm_groups.keys.to_set - exceptions.to_set).each do |group_name|
        deprovision_group(group_name) # clean this after everything finishes
      end
    end
1194687
function teardownAll() {
      var componentInfo = registry.findComponentInfo(this);

      componentInfo && Object.keys(componentInfo.instances).forEach(function(k) {
        var info = componentInfo.instances[k];
        // It's possible that a previous teardown caused another component to teardown,
        // so we can't assume that the instances object is as it was.
        if (info && info.instance) {
          info.instance.teardown();
        }
      });
    }
434421
function deleteGroup(name, done) {
  return getGroup(name, function(getGroupErr, group) {
    if (getGroupErr) {
      return done(getGroupErr);
    }

    if (!group) {
      return done(new Error(`group '${name}' not found`));
    }

    return group.destroy(done);
  });
}
684641
function(uid, sid, group) {
  if(!uid || !sid || !group) {
    return false;
  }

  for(let i=0, l=group.length; i<l; i++) {
    if(group[i] === uid) {
      group.splice(i, 1);
      return true;
    }
  }

  return false;
}
933306
function createSetup( widgetConfiguration ) {

   beforeEach( axMocks.setupForWidget() );

   beforeEach( () => {
      axMocks.widget.configure( widgetConfiguration );
   } );

   beforeEach( axMocks.widget.load );

   beforeEach( () => {
      testEventBus = axMocks.eventBus;
   } );

   beforeEach( () => { widgetDom = axMocks.widget.render(); } );
}
579339
function (handler, group, callback) {

    if (typeof group === 'function') {
      callback = group;
      group = undefined;
    }

    const validation = cache.get(constant.SYSTEM_DB_VALIDATOR).filter(item => {
      return item.group === (group || handler.req.path);
    });

    async.mapSeries(validation, (item, next) => {

      const func = rule[item.rule];
      if (func) {
        return func.call(this, handler, item, next);
      }

      log.debug('Rule does not define : ' + item.rule);
      next();
    }, (err, result) => {
      if (err) {
        return callback(err);
      }

      result = _.compact(_.flatten(result));
      if (_.isEmpty(result)) {
        return callback();
      }

      log.info(result);
      callback(new error.ParamError(), result);
    });
  }
343952
function shouldNotWrap(groups) {
    const hasComputed =
      groups[1].length && groups[1][0].node.kind === "offsetlookup";

    if (groups[0].length === 1) {
      const firstNode = groups[0][0].node;

      return (
        (firstNode.kind === "variable" && firstNode.name === "this") ||
        isReferenceLikeNode(firstNode)
      );
    }

    const lastNode = getLast(groups[0]).node;

    return (
      isLookupNode(lastNode) &&
      (lastNode.offset.kind === "identifier" ||
        lastNode.offset.kind === "variable") &&
      hasComputed
    );
  }
806674
function( name, testEnvironment ) {
		var currentModule = {
			name: name,
			testEnvironment: testEnvironment,
			tests: []
		};

		// DEPRECATED: handles setup/teardown functions,
		// beforeEach and afterEach should be used instead
		if ( testEnvironment && testEnvironment.setup ) {
			testEnvironment.beforeEach = testEnvironment.setup;
			delete testEnvironment.setup;
		}
		if ( testEnvironment && testEnvironment.teardown ) {
			testEnvironment.afterEach = testEnvironment.teardown;
			delete testEnvironment.teardown;
		}

		config.modules.push( currentModule );
		config.currentModule = currentModule;
	}
80683
function (config) {
        // at this stage, the `db` variable should not exist. expecting fresh setup or post teardown setup.
        if (Transaction.databases[config.identity]) {
            // @todo - emit wrror event instead of console.log
            console.log('Warn: duplicate setup of connection found in Transactions.setup');
            this.teardown();
        }

        var _db;

        // clone the configuration
        config = util.clone(config);
        delete config.replication;

        // allow special transaction related config
        util.each(config, function (value, name, config) {
            if (!/^transaction.+/g.test(name)) { return; }

            // remove transaction config prefix
            var baseName = name.replace(/^transaction/g, '');
            baseName = baseName.charAt(0).toLowerCase() + baseName.slice(1);

            delete config[name];
            config[baseName] = value;
        });

        _db = db.createSource(config);

        // Save a few configurations
        _db && (_db.transactionConfig = {
            rollbackOnError: config.rollbackTransactionOnError
        });

        Transaction.databases[config.identity] = _db;
    }
402777
function boilerplateSetup (callback) {
  var target = path.join(process.cwd(), exercise.boilerplateOut[boilerplateName])
  copy.copyDeps(target, callback)
}
1399
def group_remove(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('group:remove', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
    })
922476
function _LayoutCommon_ensureContainerSize(group) {
                    var sizes = this._sizes;
                    if (!sizes.containerSizeLoaded && !this._ensuringContainerSize) {
                        var promise;
                        if ((!this._itemInfo || typeof this._itemInfo !== "function") && this._useDefaultItemInfo) {
                            var margins = sizes.containerMargins;
                            promise = Promise.wrap({
                                width: group.groupInfo.cellWidth - margins.left - margins.right,
                                height: group.groupInfo.cellHeight - margins.top - margins.bottom
                            });

                        } else {
                            promise = this._getItemInfo();
                        }

                        var that = this;
                        this._ensuringContainerSize = promise.then(function (itemSize) {
                            sizes.containerSizeLoaded = true;
                            sizes.containerWidth = itemSize.width + sizes.itemBoxOuterWidth + sizes.containerOuterWidth;
                            sizes.containerHeight = itemSize.height + sizes.itemBoxOuterHeight + sizes.containerOuterHeight;
                            if (!that._inListMode) {
                                that._itemsPerBar = Math.floor(sizes.maxItemsContainerContentSize / sizes.containerCrossSize);
                                if (that.maximumRowsOrColumns) {
                                    that._itemsPerBar = Math.min(that._itemsPerBar, that.maximumRowsOrColumns);
                                }
                                that._itemsPerBar = Math.max(1, that._itemsPerBar);
                            } else {
                                that._itemsPerBar = 1;
                            }
                            that._createContainerStyleRule();
                        });

                        promise.done(
                            function () {
                                that._ensuringContainerSize = null;
                            },
                            function () {
                                that._ensuringContainerSize = null;
                            }
                        );

                        return promise;
                    } else {
                        return this._ensuringContainerSize ? this._ensuringContainerSize : Promise.wrap();
                    }
                }