<commit_before>'use strict';

const {expect} = require('chai');
const fs = require('fs-extra');

require('../init');

const fepper = global.fepper;
const installer = fepper.tasks.installer;

describe('Installer', function () {
  let extendDirExistsBefore;
  let sourceDirExistsBefore;

  before(function () {
    installer.sourceDir = installer.sourceDir + '-installer-test';
  });

  beforeEach(function () {
    fs.removeSync(installer.extendDir);
    fs.removeSync(installer.sourceDir);

    extendDirExistsBefore = fs.existsSync(installer.extendDir);
    sourceDirExistsBefore = fs.existsSync(installer.sourceDir);
  });

  it('.copy() copies main profile source and extend dirs', function () {
    installer.appDir = `${global.rootDir}/root-installer-test`;

    installer.copy();

    const extendDirContentsAfter = fs.readdirSync(installer.extendDir).toString();
    const sourceDirContentsAfter = fs.readdirSync(installer.sourceDir).toString();
    const pagesDirContentsAfter = fs.readdirSync(`${installer.sourceDir}/_patterns/98-scrape`).toString();

    expect(extendDirExistsBefore).to.be.false;
    expect(sourceDirExistsBefore).to.be.false;<commit_msg>another attempt copy source dir as part of installer test<commit_after>'use strict';

const {expect} = require('chai');
const fs = require('fs-extra');

require('../init');

const fepper = global.fepper;
const installer = fepper.tasks.installer;

describe('Installer', function () {
  let extendDirExistsBefore;
  let sourceDirExistsBefore;

  before(function () {
    installer.sourceDir = installer.sourceDir + '-installer-test';
  });

  beforeEach(function () {
    fs.removeSync(installer.extendDir);
    fs.removeSync(installer.sourceDir);

    extendDirExistsBefore = fs.existsSync(installer.extendDir);
    sourceDirExistsBefore = fs.existsSync(installer.sourceDir);
  });

  it('.copy() copies main profile source and extend dirs', function () {
    installer.appDir = `${global.rootDir}/root-installer-test`;

    installer.copy();

    const extendDirContentsAfter = fs.readdirSync(installer.extendDir).toString();
    const sourceDirContentsAfter = fs.readdirSync(installer.sourceDir).toString();
    const pagesDirContentsAfter = fs.readdirSync(`${installer.sourceDir}/_patterns/04-pages`).toString();

    expect(extendDirExistsBefore).to.be.false;
    expect(sourceDirExistsBefore).to.be.false;
{'fraction_non_alphanumeric': 0.13726315789473684, 'fraction_numerical': 0.0016842105263157896, 'mean_word_length': 5.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6118113', 'n_tokens_mistral': 724, 'n_tokens_neox': 699, 'n_words': 118}