<commit_before>var include = require('../index'),
  assert = require('assert'),
  fs = require('fs'),
  exec = require('child_process').execFileSync;

['cli'].forEach(function(file) {
  var tests = require('./tests/' + file + '.json');
  for (var category in tests) {
    describe(category, function() {
      tests[category].forEach(function(test) {
        it(test.name || 'include', function(done) {
          var out = exec('node', ['bin/cli.js', test.template]);
          var json = JSON.parse(out.toString());
          delete json.Metadata;
          assert.deepEqual(json, test.output);
          done();
        });
      });
    });
  }
});<commit_msg>execFileSync is only available in Node > 0.10 :-(<commit_after>var include = require('../index'),
  assert = require('assert'),
  fs = require('fs'),
  exec = require('child_process').execSync; // execFileSync is only available in Node > 0.10 :-(

['cli'].forEach(function(file) {
  var tests = require('./tests/' + file + '.json');
  for (var category in tests) {
    describe(category, function() {
      tests[category].forEach(function(test) {
        it(test.name || 'include', function(done) {
          var out = exec('node bin/cli.js ' + test.template);
          var json = JSON.parse(out.toString());
          delete json.Metadata;
          assert.deepEqual(json, test.output);
          done();
        });
      });
    });
  }
});
{'fraction_non_alphanumeric': 0.18394886363636365, 'fraction_numerical': 0.004261363636363636, 'mean_word_length': 2.717678100263852, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1928814', 'n_tokens_mistral': 415, 'n_tokens_neox': 410, 'n_words': 92}