<commit_before>import test from './async-test';
import { resolve } from 'path';
import { create, build } from './lib/cli';
import lsr from './lib/lsr';
import { setup, clean } from './lib/output';
import { normalize, expectedOutputs } from './build.snapshot';

const options = { timeout: 30 * 1000 };

test('preact build - before', async () => {
	await setup();
});

['empty', 'simple', 'root', 'default'].forEach(template =>
	test(`preact build - should produce output. Veryfing ${template}`, options, async t => {
		let app = await create('app', template);
		await build(app);

		let output = await lsr(resolve(app, 'build'));

		t.isEquivalent(normalize(output), expectedOutputs[template]);
	})
);

test('preact build - after', async () => {
	await clean();
});
<commit_msg>test: Preact CLI increase build timeout<commit_after>import test from './async-test';
import { resolve } from 'path';
import { create, build } from './lib/cli';
import lsr from './lib/lsr';
import { setup, clean } from './lib/output';
import { normalize, expectedOutputs } from './build.snapshot';

const options = { timeout: 45 * 1000 };

test('preact build - before', async () => {
	await setup();
});

['empty', 'simple', 'root', 'default'].forEach(template =>
	test(`preact build - should produce output. Veryfing ${template}`, options, async t => {
		let app = await create('app', template);
		await build(app);

		let output = await lsr(resolve(app, 'build'));

		t.isEquivalent(normalize(output), expectedOutputs[template]);
	})
);

test('preact build - after', async () => {
	await clean();
});

{'fraction_non_alphanumeric': 0.18670886075949367, 'fraction_numerical': 0.007594936708860759, 'mean_word_length': 4.489583333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4781887', 'n_tokens_mistral': 503, 'n_tokens_neox': 481, 'n_words': 149}