<commit_before>var assert = require('assert');
var fs = require('fs');
var path = require('path');
var validator = require('html-validator');
var inValidatorOpts  = {format: 'text'};
var outValidatorOpts = {format: 'text'};
var expValidatorOpts = {format: 'text'};
var outContent = "";
var expContent = "";


describe('Mocha Test Suite', function () {
	describe('hooks', function() {
		before(function (done) {
			var filePath = path.join(__dirname, '../tmp/test/fixtures/index.html');
			fs.readFile(filePath, 'utf8', function (err, data) {
				if (!err) {
					inValidatorOpts.data = data;
				} else {
					console.log('Error getting input html content: ', err);
				}
			});
			filePath = path.join(__dirname, '../tmp/output/test/fixtures/index.html');
			fs.readFile(filePath, 'utf8', function (err, data) {
				if (!err) {
					outValidatorOpts.data = data;
					outContent = data;
				} else {
					console.log('Error getting output html content: ', err);
				}
			});
			filePath = path.join(__dirname, '../tmp/test/expected/index.html');
			fs.readFile(filePath, 'utf8', function(err, data) {
				if (!err) {
					expValidatorOpts.data = data;
					expContent = data;
					done();
				} else {
					console.log('Error getting expected html content: ', err);
				}
			})
		});
		
		describe('check for valid html input', function() {
			it('should be valid html', function(done) {
				validator(inValidatorOpts, function(err, data) {
					if (err) {
						console.log('ERROR: ', err);
						assert.equal(true, false);					
					}
					assert.equal(null, err);
					done();	
				});
			});
		});
		
		describe('check for valid html output', function() {
			it('should be valid html', function(done) {
				validator(outValidatorOpts, function(err, data) {
					if (err) {
						console.log('ERROR: ', err);
						assert.equal(true, false);
					}
					assert.equal(null, err);
					done();
				});
			});
		});
		
		describe('check if the output html matches the expected result', function() {
			it('output should match expected html', function() {
				assert.equal(expContent, outContent);
			});
		})
	});
});
<commit_msg>added timeout to allow extra time for test running in server<commit_after>var assert = require('assert');
var fs = require('fs');
var path = require('path');
var validator = require('html-validator');
var inValidatorOpts  = {format: 'text'};
var outValidatorOpts = {format: 'text'};
var expValidatorOpts = {format: 'text'};
var outContent = "";
var expContent = "";


describe('Mocha Test Suite', function () {
	this.timeout(15000);
	describe('hooks', function() {
		before(function (done) {
			var filePath = path.join(__dirname, '../tmp/test/fixtures/index.html');
			fs.readFile(filePath, 'utf8', function (err, data) {
				if (!err) {
					inValidatorOpts.data = data;
				} else {
					console.log('Error getting input html content: ', err);
				}
			});
			filePath = path.join(__dirname, '../tmp/output/test/fixtures/index.html');
			fs.readFile(filePath, 'utf8', function (err, data) {
				if (!err) {
					outValidatorOpts.data = data;
					outContent = data;
				} else {
					console.log('Error getting output html content: ', err);
				}
			});
			filePath = path.join(__dirname, '../tmp/test/expected/index.html');
			fs.readFile(filePath, 'utf8', function(err, data) {
				if (!err) {
					expValidatorOpts.data = data;
					expContent = data;
					done();
				} else {
					console.log('Error getting expected html content: ', err);
				}
			})
		});
		
		describe('check for valid html input', function() {
			it('should be valid html', function(done) {
				validator(inValidatorOpts, function(err, data) {
					if (err) {
						console.log('ERROR: ', err);
						assert.equal(true, false);					
					}
					assert.equal(null, err);
					done();	
				});
			});
		});
		
		describe('check for valid html output', function() {
			it('should be valid html', function(done) {
				validator(outValidatorOpts, function(err, data) {
					if (err) {
						console.log('ERROR: ', err);
						assert.equal(true, false);
					}
					assert.equal(null, err);
					done();
				});
			});
		});
		
		describe('check if the output html matches the expected result', function() {
			it('output should match expected html', function(done) {
				assert.equal(expContent, outContent);
				done();
			});
		})
	});
});

{'fraction_non_alphanumeric': 0.16770186335403728, 'fraction_numerical': 0.0025304807913503567, 'mean_word_length': 3.1135288552507094, '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': '563595', 'n_tokens_mistral': 1720, 'n_tokens_neox': 1361, 'n_words': 336}