<commit_before>/*
 * mocaccino.js
 *
 * Copyright (c) 2014 <NAME> <<EMAIL>>
 *
 * @license MIT
 */
'use strict';

var through = require('through');
var resolve = require('resolve');
var path    = require('path');
var fs      = require('fs');


module.exports = function (b, opts) {
  if (!opts) {
    opts = {};
  }
  var reporter = opts.reporter || opts.R || 'tap';
  var setupFile;
  if (opts.node) {
    b.exclude('mocha');
    setupFile = 'setup-node.js';
  } else {
    b.noParse(require.resolve('mocha/mocha'));
    setupFile = 'setup-browser.js';
  }
  setupFile = path.join(__dirname, setupFile);
  b.require(setupFile, { expose : 'mocaccino-setup' });

  // Transform must be global to make sure it is applied last:
  b.transform({ global : true }, function (file) {
    if (file === setupFile) {
      var content = '';
      return through(function (buf) {
        content += buf;
      }, function () {
        this.queue(content.replace('{{REPORTER}}', reporter));
        this.queue(null);
      });
    }
    if (b.files.indexOf(file) === -1) {
      return through();
    }
    return through(function (data) {
      this.queue('require("mocaccino-setup");');
      this.queue(data);
    });
  });
};<commit_msg>Do not add internal test setup file to browserify main files<commit_after>/*
 * mocaccino.js
 *
 * Copyright (c) 2014 <NAME> <<EMAIL>>
 *
 * @license MIT
 */
'use strict';

var through = require('through');
var resolve = require('resolve');
var path    = require('path');
var fs      = require('fs');


module.exports = function (b, opts) {
  if (!opts) {
    opts = {};
  }
  var reporter = opts.reporter || opts.R || 'tap';
  var setupFile;
  if (opts.node) {
    b.exclude('mocha');
    setupFile = 'setup-node.js';
  } else {
    b.noParse(require.resolve('mocha/mocha'));
    setupFile = 'setup-browser.js';
  }
  setupFile = path.join(__dirname, setupFile);

  // Transform must be global to make sure it is applied last:
  b.transform({ global : true }, function (file) {
    if (file === setupFile) {
      var content = '';
      return through(function (buf) {
        content += buf;
      }, function () {
        this.queue(content.replace('{{REPORTER}}', reporter));
        this.queue(null);
      });
    }
    if (b.files.indexOf(file) === -1) {
      return through();
    }
    return through(function (data) {
      this.queue('require("' + setupFile + '");');
      this.queue(data);
    });
  });
};
{'fraction_non_alphanumeric': 0.18129848917925684, 'fraction_numerical': 0.004083299305839118, 'mean_word_length': 2.7576687116564416, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2591659', 'n_tokens_mistral': 819, 'n_tokens_neox': 794, 'n_words': 192}