<commit_before>'use strict';
const reviewFetcher = require('../lib/reviewFetcher.js');
const should = require("should");
const co = require("co");

describe("Getting reviews", function () {

	beforeEach(function (done) {
		this.timeout(5000);
		done();
	});

	it("has a util to get review keys", function(done) {
		should.exists(reviewFetcher.getReviewKeys);
		done();
	});

	it("has a util to get one review data", function(done) {
		should.exists(reviewFetcher.getReviewData);
		done();
	});

	it("get review keys", function (done) {
			let result = reviewFetcher.getReviewKeys();
			result.length.should.be.above(2);
			done();
	});

	describe("get review from one url", function (done) {
		this.timeout(20000);
		let review = {};

		before(function (done){
			co(function *() {
				review = yield reviewFetcher.getReviewData("KanbanGoodRead");
			}).then(done, done);
		});

		it("should get the result at all", () => review.should.not.be.empty );
		it("review has a key", () => review.key.should.not.be.empty );
		it("review has a heading", () => review.header.should.not.be.empty );
		it("review has a body", () => review.body.should.not.be.empty );
		it("review has a link", () => review.link.should.not.be.empty );
		it("review body for KanbanGoodReads has some nice text", () => {
			review.body.should.startWith("");
		});
	});
});<commit_msg>Minor refactorings<commit_after>'use strict';
const reviewFetcher = require('../lib/reviewFetcher.js');
const should = require("should");
const co = require("co");

describe("Getting reviews", function () {

	beforeEach(function (done) {
		this.timeout(5000);
		done();
	});

	it("has a util to get review keys", function(done) {
		should.exists(reviewFetcher.getReviewKeys);
		done();
	});

	it("has a util to get one review data", function(done) {
		should.exists(reviewFetcher.getReviewData);
		done();
	});

	it("get review keys", function (done) {
			let result = reviewFetcher.getReviewKeys();
			result.length.should.be.above(2);
			done();
	});

	describe("get review from a key", function (done) {
		this.timeout(20000);
		let review = {};

		before(function (done){
			co(function *() {
				review = yield reviewFetcher.getReviewData("KanbanGoodRead");
			}).then(done, done);
		});

		it("should get the result at all", () => review.should.not.be.empty );
		it("review has a key", () => review.key.should.not.be.empty );
		it("review has a heading", () => review.header.should.not.be.empty );
		it("review has a body", () => review.body.should.not.be.empty );
		it("review has a link", () => review.link.should.not.be.empty );
		it("review body for KanbanGoodReads has some nice text", () => {
			review.body.should.endWith(" out of 5");
		});
	});
});
{'fraction_non_alphanumeric': 0.18556701030927836, 'fraction_numerical': 0.007731958762886598, 'mean_word_length': 4.116760828625235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '744301', 'n_tokens_mistral': 976, 'n_tokens_neox': 887, 'n_words': 210}