<commit_before>import test from 'ava';
import yn from './';

test('truthy cases', t => {
	[
		'y',
		'Y',
		'yes',
		'YES',
		'Yes',
		'true',
		true,
		1
	].forEach(el => {
		t.true(yn(el));
		t.true(yn(el, {lenient: true}));
	});

	t.end();
});

test('falsey cases', t => {
	[
		'n',
		'N',
		'no',
		'NO',
		'No',
		'false',
		false,
		0
	].forEach(el => {
		t.false(yn(el));
		t.false(yn(el, {lenient: true}));
	});

	t.end();
});

test('edge cases which return null', t => {
	t.is(yn(NaN), null);
	t.is(yn(''), null);
	t.is(yn('yn'), null);
	t.is(yn('unicorn'), null);
	t.is(yn(NaN, {lenient: true}), null);
	t.is(yn('', {lenient: true}), null);
	t.is(yn('yn', {lenient: true}), null);
	t.is(yn('unicorn', {lenient: true}), null);
	t.end();
});

test('lenient option - truthy value cases', t => {
	t.true(yn('ues', {lenient: true}));
	t.true(yn('ywa', {lenient: true}));
	t.true(yn('tes', {lenient: true}));
	t.true(yn('twa', {lenient: true}));
	t.true(yn('urd', {lenient: true}));
	t.end();
});

test('lenient option - falsey value cases', t => {
	t.false(yn('ni', {lenient: true}));
	t.false(yn('bi', {lenient: true}));
	t.false(yn('mo', {lenient: true}));
	t.end();
});<commit_msg>update tests for latest AVA version<commit_after>import test from 'ava';
import yn from './';

test('truthy cases', t => {
	[
		'y',
		'Y',
		'yes',
		'YES',
		'Yes',
		'true',
		true,
		1
	].forEach(el => {
		t.true(yn(el));
		t.true(yn(el, {lenient: true}));
	});
});

test('falsey cases', t => {
	[
		'n',
		'N',
		'no',
		'NO',
		'No',
		'false',
		false,
		0
	].forEach(el => {
		t.false(yn(el));
		t.false(yn(el, {lenient: true}));
	});
});

test('edge cases which return null', t => {
	t.is(yn(NaN), null);
	t.is(yn(''), null);
	t.is(yn('yn'), null);
	t.is(yn('unicorn'), null);
	t.is(yn(NaN, {lenient: true}), null);
	t.is(yn('', {lenient: true}), null);
	t.is(yn('yn', {lenient: true}), null);
	t.is(yn('unicorn', {lenient: true}), null);
});

test('lenient option - truthy value cases', t => {
	t.true(yn('ues', {lenient: true}));
	t.true(yn('ywa', {lenient: true}));
	t.true(yn('tes', {lenient: true}));
	t.true(yn('twa', {lenient: true}));
	t.true(yn('urd', {lenient: true}));
});

test('lenient option - falsey value cases', t => {
	t.false(yn('ni', {lenient: true}));
	t.false(yn('bi', {lenient: true}));
	t.false(yn('mo', {lenient: true}));
});
{'fraction_non_alphanumeric': 0.2921635434412266, 'fraction_numerical': 0.0017035775127768314, 'mean_word_length': 4.008528784648187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '7398886', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1062, 'n_words': 220}