<commit_before>var app = require('../app'),
	expect = require('expect.js');

//test url - this has alot of OG info
var options1 = {
	'url': 'http://ogp.me/'
};

//test url formats
var	options2 = {
		'url': 'http://www.google.com/'
	},
	options3 = {
		'url': 'https://www.google.com/'
	},
	options4 = {
		'url': 'www.google.com/'
	},
	options5 = {
		'url': 'google.com/'
	},
	options6 = {
		'url': 'http://google.com/'
	};

//invaild url
var options7 = {
	'url': 'http://testtesttest4564568.com'
};

//empty value
var optionsEmpty = {
	'url': ''
};

// test timeout
var options8 = {
		'url': 'http://www.google.com/',
		'timeout': 2000
	},
	options9 = {
		'url': 'http://www.google.com/',
		'timeout': ''
	},
	options10 = {
		'url': 'http://www.google.com/',
		'timeout': '2000'
	},
	options11 = {
		'url': 'http://www.google.com/',
		'timeout': 'sdsdds'
	};

// some bad urls
var options12 = {
		'url': 23233
	},
	options13 = {
		'url': '2323233'
	},
	options14 = {
		'url': 'this is a testt'
	};

//no url
var optionsNoUrl = { };

describe('GET OG', function () {
	this.timeout(3000); //shoudl wait atleast 3secs before failing
	it('Valid call og - url1', function (done) {
		app(options1, function (err, result) {
			expect(err).to.be(null);
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url2', function (done) {
		app(options2, function (err, result) {
			expect(err).to.be(null);
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url3', function (done) {
		app(options3, function (err, result) {
			expect(err).to.be(null);
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url4', function (done) {
		app(options4, function (err, result) {
			expect(err).to.be(null);
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url5', function (done) {
		app(options5, function (err, result) {
			expect(err).to.be(null);
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url6', function (done) {
		app(options6, function (err, result) {
			expect(err).to.be(null);
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Invalid call og - url7', function (done) {
		app(options7, function (err, result) {
			expect(result.success).to.be(false);
			done();
		});
	});
	it('Invalid get og - empty url', function (done) {
		app(optionsEmpty, function (err, result) {
			expect(result.err).to.be('Invalid URL');
			expect(result.success).to.be(false);
			done();
		});
	});
	it('Valid call og - url8', function (done) {
		app(options8, function (err, result) {
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url9', function (done) {
		app(options9, function (err, result) {
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url10', function (done) {
		app(options10, function (err, result) {
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url11', function (done) {
		app(options11, function (err, result) {
			expect(result.success).to.be(true);
			done();
		});
	});
	it('Valid call og - url12', function (done) {
		app(options12, function (err, result) {
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
	it('Valid call og - url13', function (done) {
		app(options13, function (err, result) {
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
	it('Valid call og - url14', function (done) {
		app(options14, function (err, result) {
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
	it('Invalid get og - no url', function (done) {
		app(optionsNoUrl, function (err, result) {
			expect(result.err).to.be('Invalid URL');
			expect(result.success).to.be(false);
			done();
		});
	});
});
<commit_msg>make the tests alittle more useful<commit_after>var app = require('../app'),
	expect = require('expect.js');

// test url - this has alot of OG info
var options1 = {
	'url': 'http://ogp.me/'
};

// test url formats
var	options2 = {
		'url': 'http://www.google.com/'
	},
	options3 = {
		'url': 'https://www.google.com/'
	},
	options4 = {
		'url': 'www.google.com/'
	},
	options5 = {
		'url': 'google.com/'
	},
	options6 = {
		'url': 'http://google.com/'
	};

// invaild url
var options7 = {
	'url': 'http://testtesttest4564568.com'
};

// empty value
var optionsNoUrl = {
	'url': ''
};

// no url
var optionsEmpty = { };

// test timeout
var options8 = {
		'url': 'http://www.google.com/',
		'timeout': 2000
	},
	options9 = {
		'url': 'http://www.google.com/',
		'timeout': ''
	},
	options10 = {
		'url': 'http://www.google.com/',
		'timeout': '2000'
	},
	options11 = {
		'url': 'http://www.google.com/',
		'timeout': 'sdsdds'
	};

// some bad urls
var options12 = {
		'url': 23233
	},
	options13 = {
		'url': '2323233'
	},
	options14 = {
		'url': 'this is a testt'
	};

describe('GET OG', function () {
	this.timeout(3000); // should wait at least three seconds before failing
	it('Valid Call - ogp.me should return open graph data', function (done) {
		app(options1, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data.ogTitle).to.be('Open Graph protocol');
			expect(result.data.ogType).to.be('website');
			expect(result.data.ogUrl).to.be('http://ogp.me/');
			expect(result.data.ogDescription).to.be('The Open Graph protocol enables any web page to become a rich object in a social graph.');
			expect(result.data.ogImage.url).to.be('http://ogp.me/logo.png');
			expect(result.data.ogImage.width).to.be('300');
			expect(result.data.ogImage.height).to.be('300');
			expect(result.data.ogImage.type).to.be('image/png');
			done();
		});
	});
	it('Valid Call - http', function (done) {
		app(options2, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - https', function (done) {
		app(options3, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - no protocol', function (done) {
		app(options4, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - no protocol and no wwww', function (done) {
		app(options5, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - protocol with no wwww', function (done) {
		app(options6, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Invalid Call - fake page', function (done) {
		app(options7, function (err, result) {
			expect(err).to.be(true);
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
	it('Invalid Call - empty url', function (done) {
		app(optionsNoUrl, function (err, result) {
			expect(err).to.be(true);
			expect(result.success).to.be(false);
			expect(result.err).to.be('Invalid URL');
			done();
		});
	});
	it('Invalid Call - empty options', function (done) {
		app(optionsEmpty, function (err, result) {
			expect(err).to.be(true);
			expect(result.err).to.be('Invalid URL');
			expect(result.success).to.be(false);
			done();
		});
	});
	it('Valid Call - timeout set to 2000', function (done) {
		app(options8, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - timeout set to empty string', function (done) {
		app(options9, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - timeout number is a string', function (done) {
		app(options10, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Valid Call - time is just a string of chars', function (done) {
		app(options11, function (err, result) {
			expect(err).to.be(false);
			expect(result.success).to.be(true);
			expect(result.data).to.be.empty();
			done();
		});
	});
	it('Invalid Call - url is just a number', function (done) {
		app(options12, function (err, result) {
			expect(err).to.be(true);
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
	it('Invalid Call - url is a string of numbers', function (done) {
		app(options13, function (err, result) {
			expect(err).to.be(true);
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
	it('Invalid Call - url is a string of words', function (done) {
		app(options14, function (err, result) {
			expect(err).to.be(true);
			expect(result.success).to.be(false);
			expect(result.err).to.be('Page Not Found');
			done();
		});
	});
});

{'fraction_non_alphanumeric': 0.20321682647695638, 'fraction_numerical': 0.01732137333745747, 'mean_word_length': 2.936688311688312, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 16, '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': '2839534', 'n_tokens_mistral': 3893, 'n_tokens_neox': 3460, 'n_words': 708}