<commit_before>const should = require("should");
const build = require(`../${process.env.TRAVIS ? "dist" : "build"}/commonjs/index.js`);
const FuseBox = build.FuseBox;

function runFuse (options, str) {
	options = Object.assign({
		log: false,
		cache: false,
		plugins: [build.JSONPlugin()],
	}, options);

	return new FuseBox(options).bundle(str);
}

function test (n, plugins) {
	const files = {};
	const range = [...Array(n).keys()];

	range.reduceRight((prev, cur, idx, array) => {
		if (idx + 1 === array.length - 1) {
			files[`file-${prev}.js`] = `module.exports = 'content';`
		}

		files[`file-${cur}.js`] = `require('file-${prev}.js');`;

		return cur;
	});

	const startTime = new Date().getTime();
	return runFuse({files}, '**/*.js').then(root => {
		return new Date().getTime() - startTime;
	});
}

const data = [
	[10, 70],
	[100, 120],
	[1000, 1000],
	[2000, 2200]
];

describe('Pefomance test', function () {
	this.timeout(10000);

	data.forEach(value => {
		it(`Should create an assembly from ${value[0]} files of less than ${value[1]} ms`, () => {
			return test(value[0]).then(diff => {
				should.equal(diff <= value[1], true, `Actual diff: ${diff}`);

				return true;
			});
		});
	});
});<commit_msg>Fix typo<commit_after>const should = require("should");
const build = require(`../${process.env.TRAVIS ? "dist" : "build"}/commonjs/index.js`);
const FuseBox = build.FuseBox;

function runFuse (options, str) {
	options = Object.assign({
		log: false,
		cache: false,
		plugins: [build.JSONPlugin()],
	}, options);

	return new FuseBox(options).bundle(str);
}

function test (n, plugins) {
	const files = {};
	const range = [...Array(n).keys()];

	range.reduceRight((prev, cur, idx, array) => {
		if (idx + 1 === array.length - 1) {
			files[`file-${prev}.js`] = `module.exports = 'content';`
		}

		files[`file-${cur}.js`] = `require('file-${prev}.js');`;

		return cur;
	});

	const startTime = new Date().getTime();
	return runFuse({files}, '**/*.js').then(root => {
		return new Date().getTime() - startTime;
	});
}

const data = [
	[10, 70],
	[100, 120],
	[1000, 1000],
	[2000, 2200]
];

describe('Perfomance test', function () {
	this.timeout(10000);

	data.forEach(value => {
		it(`Should create an assembly from ${value[0]} files of less than ${value[1]} ms`, () => {
			return test(value[0]).then(diff => {
				should.equal(diff <= value[1], true, `Actual diff: ${diff}`);

				return true;
			});
		});
	});
});
{'fraction_non_alphanumeric': 0.22585924713584288, 'fraction_numerical': 0.030278232405891982, 'mean_word_length': 3.9294354838709675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '3261855', 'n_tokens_mistral': 999, 'n_tokens_neox': 890, 'n_words': 201}