<commit_before>const fs = require('fs');
const path = require('path');
const assert = require('assert');
const glob = require('tiny-glob/sync.js');
const shell = require("shelljs");

const cli = path.resolve(__dirname, "../../cli/index.js");

function normalize(str) {
	return str
		.replace(/^\s+$/gm, '')
		.replace(
			/\/\*(.*?)generated by Svelte v[.\d]+/,
			(_, path) => `/*${path.replace(/\\/g, '/')}generated by Svelte vx.y.z`
		)
		.trim();
}

const cwd = process.cwd();

describe('cli', () => {
	afterEach(() => {
		process.chdir(cwd);
	});

	fs.readdirSync('test/cli/samples').forEach(dir => {
		if (dir[0] === '.') return;

		// append .solo to test dir to only run that test
		const solo = /\.solo$/.test(dir);

		(solo ? it.only : it)(dir, done => {
			process.chdir(`${__dirname}/samples/${dir}`);

			const command = fs.readFileSync('command.sh', 'utf-8');

			shell.mkdir("-p", "actual");
			shell.rm("-rf", "actual/*");
			const { commandErr } = shell.exec(<commit_msg>increase timeout so that tests pass on this horrendously expensive piece of shit laptop i am forced to use. PS fuck you, apple<commit_after>const fs = require('fs');
const path = require('path');
const assert = require('assert');
const glob = require('tiny-glob/sync.js');
const shell = require("shelljs");

const cli = path.resolve(__dirname, "../../cli/index.js");

function normalize(str) {
	return str
		.replace(/^\s+$/gm, '')
		.replace(
			/\/\*(.*?)generated by Svelte v[.\d]+/,
			(_, path) => `/*${path.replace(/\\/g, '/')}generated by Svelte vx.y.z`
		)
		.trim();
}

const cwd = process.cwd();

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

	afterEach(() => {
		process.chdir(cwd);
	});

	fs.readdirSync('test/cli/samples').forEach(dir => {
		if (dir[0] === '.') return;

		// append .solo to test dir to only run that test
		const solo = /\.solo$/.test(dir);

		(solo ? it.only : it)(dir, done => {
			process.chdir(`${__dirname}/samples/${dir}`);

			const command = fs.readFileSync('command.sh', 'utf-8');

			shell.mkdir("-p", "actual");
			shell.rm("-rf", "actual/*");
			const { commandErr } = shell.exec(
{'fraction_non_alphanumeric': 0.23145961265942372, 'fraction_numerical': 0.004251299008030231, 'mean_word_length': 3.4968152866242037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5478352', 'n_tokens_mistral': 816, 'n_tokens_neox': 754, 'n_words': 173}