<commit_before>var amok = require('../');
var test = require('tape');
var fs = require('fs');

test('compile to automatic file', function(t) {
  var compilers = [
    {
      name: 'babel',
      args: [
        'test/fixture/bundle.js'
      ]
    },
    {
      name: 'browserify',
      args: [
        'test/fixture/bundle.js'
      ]
    },
    {
      name: 'browserify',
      args: [
        'test/fixture/bundle-babel.js',
        '--transform',
        'babelify'
      ]
    },
    {
      name: 'coffeescript',
      args: [
        'test/fixture/coffeescript.coffee'
      ]
    },
    {
      name: 'webpack',
      args: [
        'test/fixture/bundle.js'
      ]
    },
    {
      name: 'webpack',
      args: [
        'test/fixture/bundle-babel.js',
        '--module-bind',
        'js=babel'
      ]
    }
  ];

  compilers.forEach(function(compiler) {
    t.test(function(t) {
      var exe = amok.compile(compiler.name, compiler.args, compiler.options);
      exe.stderr.on('data', function(data) {
        data = data.toString();
        t.fail(data);
      });

      exe.on('ready', function(scripts) {
        var filenames = Object.keys(scripts);
        t.equal(filenames.length, 1);

        var stats = fs.statSync(filenames[0]);
        t.ok(stats.size > 1);

        var pathnames = filenames.map(function(filename) {
          return scripts[filename];
        });

        t.equal(pathnames.length, 1);<commit_msg>Add name to differentiate between compile tests<commit_after>var amok = require('../');
var test = require('tape');
var fs = require('fs');

test('compile to automatic file', function(t) {
  var compilers = [
    {
      name: 'babel',
      args: [
        'test/fixture/bundle.js'
      ]
    },
    {
      name: 'browserify',
      args: [
        'test/fixture/bundle.js'
      ]
    },
    {
      name: 'browserify',
      args: [
        'test/fixture/bundle-babel.js',
        '--transform',
        'babelify'
      ]
    },
    {
      name: 'coffeescript',
      args: [
        'test/fixture/coffeescript.coffee'
      ]
    },
    {
      name: 'webpack',
      args: [
        'test/fixture/bundle.js'
      ]
    },
    {
      name: 'webpack',
      args: [
        'test/fixture/bundle-babel.js',
        '--module-bind',
        'js=babel'
      ]
    }
  ];

  compilers.forEach(function(compiler) {
    t.test(compiler.name + ' ' + compiler.args.join(' '), function(t) {
      var exe = amok.compile(compiler.name, compiler.args, compiler.options);
      exe.stderr.on('data', function(data) {
        data = data.toString();
        t.fail(data);
      });

      exe.on('ready', function(scripts) {
        var filenames = Object.keys(scripts);
        t.equal(filenames.length, 1);

        var stats = fs.statSync(filenames[0]);
        t.ok(stats.size > 1);

        var pathnames = filenames.map(function(filename) {
          return scripts[filename];
        });

        t.equal(pathnames.length, 1);
{'fraction_non_alphanumeric': 0.16179926149714668, 'fraction_numerical': 0.002685464921114468, 'mean_word_length': 1.7981220657276995, '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': '7351297', 'n_tokens_mistral': 1021, 'n_tokens_neox': 987, 'n_words': 157}