<commit_before>/* eslint-env mocha, browser */
/* global proclaim */

it('has correct instance', function () {
	proclaim.isInstanceOf(Array.prototype.findIndex, Function);
});

it('has correct name', function () {
	function nameOf(fn) {
		return Function.prototype.toString.call(fn).match(/function\s*([^\s]*)\s*\(/)[1];
	}
	proclaim.equal(nameOf(Array.prototype.findIndex), 'findIndex');
});

it('has correct argument length', function () {
	proclaim.equal(Array.prototype.findIndex.length, 1);
});

describe('callback', function () {
	it('has correct argument length', function () {
		[0].findIndex(function () {
			proclaim.equal(arguments.length, 3);
		});
	});
});

describe('applies callback correctly with', function () {
	function isPrime(element) {
		var start = 1;

		while (++start <= Math.sqrt(element)) {
			if (element % start < 1) {
				return false;
			}
		}<commit_msg>improve test coverage for Array.prototype.findindex (#1611)<commit_after>/* eslint-env mocha */
/* globals proclaim */

it('is a function', function () {
	proclaim.isFunction(Array.prototype.findIndex);
});

it('has correct arity', function () {
	proclaim.arity(Array.prototype.findIndex, 1);
});

it('has correct name', function () {
	proclaim.hasName(Array.prototype.findIndex, 'findIndex');
});

it('is not enumerable', function () {
	proclaim.nonEnumerable(Array.prototype, 'findIndex');
});

describe('callback', function () {
	it('has correct argument length', function () {
		[0].findIndex(function () {
			proclaim.equal(arguments.length, 3);
		});
	});
});

describe('applies callback correctly with', function () {
	function isPrime(element) {
		var start = 1;

		while (++start <= Math.sqrt(element)) {
			if (element % start < 1) {
				return false;
			}
		}
{'fraction_non_alphanumeric': 0.18109339407744876, 'fraction_numerical': 0.008542141230068337, 'mean_word_length': 4.5777777777777775, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '7477371', 'n_tokens_mistral': 607, 'n_tokens_neox': 554, 'n_words': 120}