<commit_before>var assert = require('assert');
var utils = require('./utils.js');

require('../index.js');

describe('exports', function() {

	
	it('non-invalidable exports type', function() {
		
		var mod = new utils.TmpModule(`
			module.exports = {}
		`);
		assert.equal(typeof mod.module.exports, 'object');
	});


	it('invalidable exports type', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = {}
		`);
		assert.equal(typeof mod.module.exports, 'function');
	});


	it('exports type Object', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = {
				foo: 'bar'
			}
		`);
		assert.equal(mod.module.exports.foo, 'bar');
	});


	it('exports type Function', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = function() { return 'foo' }
		`);
		assert.equal(mod.module.exports(), 'foo');
	});
	
	
	it('exports type Array', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = [1,2,3];
		`);
		assert.equal(mod.module.exports[1], 2);
		assert.equal(mod.module.exports.length, 3);
		assert.equal(typeof mod.module.exports.map, 'function');
	});


	it('exports type primitive', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = 'foo';
		`);
		
		assert.equal(mod.module.exports, 'foo');
		//assert.throws(function() { mod.module.exports.length }, /TypeError/);
	});


	it('exports type primitive to primitive', function() {
		<commit_msg>- more tests<commit_after>var assert = require('assert');
var utils = require('./utils.js');

require('../index.js');

describe('exports', function() {

	
	it('non-invalidable exports type', function() {
		
		var mod = new utils.TmpModule(`
			module.exports = {}
		`);
		assert.equal(typeof mod.module.exports, 'object');
	});


	it('invalidable exports type', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = {}
		`);
		assert.equal(typeof mod.module.exports, 'function');
	});


	it('exports type Object', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = {
				foo: 'bar'
			}
		`);
		assert.equal(mod.module.exports.foo, 'bar');
	});


	it('exports type Function', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = function() { return 'foo' }
		`);
		assert.equal(mod.module.exports(), 'foo');
	});

	it('exports type constructor', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = class {
				constructor() {
					
					this.value = 123;
				}
				getValue() {
					
					return this.value;
				}
			}
		`);
		
		assert.equal(new mod.module.exports().getValue(), 123);
	});
	
	
	it('exports type Array', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = [1,2,3];
		`);
		assert.equal(mod.module.exports[1], 2);
		assert.equal(mod.module.exports.length, 3);
		assert.equal(typeof mod.module.exports.map, 'function');
	});


	it('exports type primitive', function() {
		
		var mod = new utils.TmpModule(`
			module.invalidable = true;
			module.exports = 'foo';
		`);
		
		assert.equal(mod.module.exports, 'foo');
		//assert.throws(function() { mod.module.exports.length }, /TypeError/);
	});


	it('exports type primitive to primitive', function() {
		
{'fraction_non_alphanumeric': 0.17759954167860212, 'fraction_numerical': 0.005156115726152965, 'mean_word_length': 3.2952029520295203, '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': '2706617', 'n_tokens_mistral': 1334, 'n_tokens_neox': 1131, 'n_words': 239}