<commit_before>'use strict';

// MODULES //

var tape = require( 'tape' );
var typeOf = require( './../lib' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof typeOf, 'function', 'export is a function' );
	t.end();
});

tape( 'the function returns a value\'s type', function test( t ) {<commit_msg>Add test cases for polyfill<commit_after>'use strict';

// MODULES //

var tape = require( 'tape' );
var proxyquire = require( 'proxyquire' );
var polyfill = require( './../lib/polyfill.js' );
var getType = require( './../lib/typeof.js' );
var typeOf = require( './../lib' );


// TESTS //

tape( 'main export is a function', function test( t ) {
	t.ok( true, __filename );
	t.equal( typeof typeOf, 'function', 'export is a function' );
	t.end();
});

tape( 'if an environment has non-standard `typeof` behavior, the main export is a polyfill', function test( t ) {
	var typeOf = proxyquire( './../lib', {
		'./check.js': check
	});

	t.equal( typeOf.toString(), polyfill.toString(), 'exports polyfill' );
	t.end();

	function check() {
		return true;
	}
});

tape( 'if an environment has standard `typeof` behavior, the main export is a function which extends built-in `typeof` behavior', function test( t ) {
	var typeOf = proxyquire( './../lib', {
		'./check.js': check
	});

	t.equal( typeOf.toString(), getType.toString(), 'exports main implementation' );
	t.end();

	function check() {
		return false;
	}
});

tape( 'the function returns a value\'s type', function test( t ) {
{'fraction_non_alphanumeric': 0.18487394957983194, 'fraction_numerical': 0.0, 'mean_word_length': 3.4869565217391303, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3220972', 'n_tokens_mistral': 521, 'n_tokens_neox': 512, 'n_words': 174}