<commit_before>'use strict';

var should = require('chai').should(),
  expect = require('chai').expect;

var requireWalk = require('..');

describe('Require Walk', function () {

  it('only accepts only a string type parameter', function (done) {

    var fn = function () {
      return requireWalk(123)();
    }

    expect(fn).to.throw(/path\ \(string\)\ is\ required/);
    done();
  });

  it('accepts only a valid directory path', function (done) {

    var fn = function () {
      return requireWalk('/does/not/exist/')();
    }

    expect(fn).to.throw(/Invalid\ pat/);
    done();
  });

  it('requires modules and applies parameters', function (done) {

    requireWalk(__dirname + '/fixtures/one')();

    // Nothing returned, just assert true
    true.should.be.true;

    done();

  });

  it('requires modules and apply optional parameters', function (done) {

    var app = {};

    requireWalk(__dirname + '/fixtures/two')(app);
<commit_msg>Minor test refactoring<commit_after>'use strict';

var should = require('chai').should(),
  expect = require('chai').expect;

var requireWalk = require('..');

describe('Require Walk', function () {

  it('only accepts only a string type parameter', function (done) {

    var fn = function () {
      return requireWalk(123)();
    }

    expect(fn).to.throw(/path\ \(string\)\ is\ required/);
    done();
  });

  it('accepts only a valid directory path', function (done) {

    var fn = function () {
      return requireWalk('/does/not/exist/')();
    }

    expect(fn).to.throw(/Invalid\ path/);
    done();
  });

  it('requires modules and applies parameters', function (done) {

    requireWalk(__dirname + '/fixtures/one')();

    // Nothing returned, just assert true
    true.should.be.true;

    done();

  });

  it('requires modules and apply optional parameters', function (done) {

    var app = {};

    requireWalk(__dirname + '/fixtures/two')(app);

{'fraction_non_alphanumeric': 0.17237798546209762, 'fraction_numerical': 0.003115264797507788, 'mean_word_length': 3.1087420042643923, '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': '892003', 'n_tokens_mistral': 598, 'n_tokens_neox': 559, 'n_words': 154}