<commit_before>/* eslint-disable */
/* global featureFile, scenarios, steps */
const Yadda = require('yadda');
const wd = require('wd');

function buildDriver(server) {
    const configServer = server || {
    host: 'localhost',
    port: 4723,
  };
  return wd.promiseChainRemote(configServer);
};

function setBaseSteps(library, device, deviceLogs) {
  library.define(
    'a mobile app',
      function setWindowSize(done) {
        console.log(deviceLogs)
       this.driver.init(device).then((built) => {
         if (deviceLogs === true) {
         this.log('set-up device', built);
         }
         done();
       });
    }
  )
  .define(
    'end the test',
    function endTest() {
      this.driver
      .quit();
    }
  );
  return library;
}

function buildYadda(library, device, server, logVerbose, deviceLogs) {
  if (library === null || library === undefined) {
    throw new Error('step library has not been defined please write some steps');
  }
  Yadda.plugins.mocha.StepLevelPlugin.init();
  const features = new Yadda.FeatureFileSearch('features');
  const builtLibrary = setBaseSteps(library, device, deviceLogs);
  if (logVerbose) {
    require("./log").configure(driver);
  }
  return features
  .each(
    file => featureFile(
      file,
      (feature) => {
        const yadda = Yadda.createInstance(
          builtLibrary,
          {
            ctx: {},
            driver: buildDriver(server),
            log: (label, data) => console.log(label, data)
          }
        );

        scenarios(
          feature.scenarios,
          (scenario) => {
            steps(<commit_msg>add if statement for logging<commit_after>/* eslint-disable */
/* global featureFile, scenarios, steps */
const Yadda = require('yadda');
const wd = require('wd');

function buildDriver(server) {
    const configServer = server || {
    host: 'localhost',
    port: 4723,
  };
  return wd.promiseChainRemote(configServer);
};

function setBaseSteps(library, device) {
  library.define(
    'a mobile app',
      function setWindowSize(done) {
       this.driver.init(device).then((built) => {
         if (device.deviceLogs) {
         this.log('set-up device', built);
         }
         done();
       });
    }
  )
  .define(
    'end the test',
    function endTest() {
      this.driver
      .quit();
    }
  );
  return library;
}

function buildYadda(library, device, server, logVerbose) {
  if (library === null || library === undefined) {
    throw new Error('step library has not been defined please write some steps');
  }
  Yadda.plugins.mocha.StepLevelPlugin.init();
  const features = new Yadda.FeatureFileSearch('features');
  const builtLibrary = setBaseSteps(library, device);
  if (logVerbose) {
    require("./log").configure(driver);
  }
  return features
  .each(
    file => featureFile(
      file,
      (feature) => {
        const yadda = Yadda.createInstance(
          builtLibrary,
          {
            ctx: {},
            driver: buildDriver(server),
            log: (label, data) => console.log(label, data)
          }
        );

        scenarios(
          feature.scenarios,
          (scenario) => {
            steps(
{'fraction_non_alphanumeric': 0.13526266121421832, 'fraction_numerical': 0.0025165146272412707, 'mean_word_length': 2.3865814696485623, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1964770', 'n_tokens_mistral': 971, 'n_tokens_neox': 961, 'n_words': 220}