{"size": 536, "ext": "js", "max_stars_repo_path": "__tests__/generate.js", "max_stars_repo_name": "browsertron/jest-webdriver-example", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "__tests__/generate.js", "max_issues_repo_name": "browsertron/jest-webdriver-example", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "__tests__/generate.js", "max_forks_repo_name": "browsertron/jest-webdriver-example", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.2105263158, "max_line_length": 88, "alphanum_fraction": 0.6473880597}
const fs = require('fs-extra');
const path = require('path');
const package = require('../package.json');

function generate(name) {
  const template = fs.readFileSync(path.join(__dirname, `${name}.template.js`), 'utf8');
  const dir = path.join(__dirname, name);
  fs.emptyDirSync(dir);

  let t = package[`${name}_tests`];
  while (t--) {
    const filepath = path.join(dir, `${t}.test.js`);
    const contents = template.replace(new RegExp('{{num}}', 'g'), t);
    fs.writeFileSync(filepath, contents);
  }
}

generate('webdriver');
