<commit_before>var request = require('supertest'), 
should = require('should'),
app = require('../index.js'),
one_chromosome = { "string": "101101101101",
		   "fitness": 0 },
great_chromosome = { "string": "whatever",
		     "fitness": 60 };

// Not really sure why I did this... 
describe( "Loads configuration correctly", function() {
    it('Should set repo correctly', function( done ) {
	app.config.should.have.property('repository', "https://github.com/JJ/splash-volunteer");
	done();
    });
});

// Check for solution, included in configuration
describe( "Loads termination correctly", function() {
    it('Should terminate when needed', function( done ) {
	app.is_solution(great_chromosome.string,great_chromosome.fitness).should.be.ok;
	done();
    });
});

// Checks the algorithm functionality 
describe( "Puts and returns chromosome", function() {
    it('should return correct type', function (done) {
	request(app)
	    .put('/experiment/0/one/'+one_chromosome.string+"/"+one_chromosome.fitness+ "/UUID")
	    .expect('Content-Type', /json/)
	    .expect(200,done);
    });
    it('should return chromosome', function (done) {
	request(app)
	    .get('/random')
	    .expect('Content-Type', /json/)
	    .expect(200)
	    .end( function ( error, resultado ) {
		if ( error ) {
		    return done( error );<commit_msg>More tests for incorrect type<commit_after>var request = require('supertest'), 
should = require('should'),
app = require('../index.js'),
one_chromosome = { "string": "101101101101",
		   "fitness": 0 },
great_chromosome = { "string": "whatever",
		     "fitness": 60 };

// Not really sure why I did this... 
describe( "Loads configuration correctly", function() {
    it('Should set repo correctly', function( done ) {
	app.config.should.have.property('repository', "https://github.com/JJ/splash-volunteer");
	done();
    });
});

// Check for solution, included in configuration
describe( "Loads termination correctly", function() {
    it('Should terminate when needed', function( done ) {
	app.is_solution(great_chromosome.string,great_chromosome.fitness).should.be.ok;
	done();
    });
});

// Checks the algorithm functionality 
describe( "Puts and returns chromosome", function() {
    it('should return correct type', function (done) {
	request(app)
	    .put('/experiment/0/one/'+one_chromosome.string+"/"+one_chromosome.fitness+ "/UUID")
	    .expect('Content-Type', /json/)
	    .expect(200,done);
    });

    it('should return incorrect type', function (done) {
	request(app)
	    .put('/experiment/1/one/'+one_chromosome.string+"/"+one_chromosome.fitness+ "/UUID")
	    .expect('Content-Type', /json/)
	    .expect(301,done);
    });
    it('should return chromosome', function (done) {
	request(app)
	    .get('/random')
	    .expect('Content-Type', /json/)
	    .expect(200)
	    .end( function ( error, resultado ) {
		if ( error ) {
		    return done( error );
{'fraction_non_alphanumeric': 0.17347990381312264, 'fraction_numerical': 0.016489178976296804, 'mean_word_length': 3.773770491803279, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6131614', 'n_tokens_mistral': 1006, 'n_tokens_neox': 886, 'n_words': 212}