<commit_before>var expect = require('chai').expect,
    unirest = require('unirest'),
    boot = require('../index').boot,
    shutdown = require('../index').shutdown,
    moment = require('moment'),
    timezone = require('moment-timezone'),
    port = 8080;

//describe('Start server', function() {
//    before(function() {
//        boot();
//    });
//});
//
//describe('Api status', function() {
//    it('should respond to get', function() {
//        unirest.get('http://localhost:' + port + '/schedule').end(function(res) {
//            expect(res.status).to.equal(200);
//        });
//    });
//    it('should say API OK', function() {
//        unirest.get('http://localhost:' + port + '/schedule').end(function(res) {
//            expect(res.body).to.equal("API OK");
//        });
//    });
//});
//
//describe('Periods agree with letter days', function() {
//    var date = moment('2015-08-27');
//    unirest.get('http://localhost:' + port + '/schedule/day_type?date=' + date).end(function(res) {
//        if(res.body.date) {
//            unirest.get('ht
//        }
//    });
//});
//
//describe('Stop server', function() {
//    after(function() {
//        shutdown();
//    }); 
//});
//
function testDay(date) {
        console.log('Here');
    unirest.get('http://localhost:' + port + '/schedule/day_type?date=' + date.format("YYYY-MM-DD")).end(function(res) {
        console.log(res.body);
        if(res.body.date) {
            unirest.get('http://localhost:' + port + '/schedule/all_periods?date=' + date.format("YYYY-MM-DD")).end(function(res2) {
                console.log(res2.body);
                console.log("Hello");
        });
        }
    }); 
}

module.exports = testDay<commit_msg>Test heading towards completion<commit_after>var expect = require('chai').expect,
    unirest = require('unirest'),
    boot = require('../index').boot,
    shutdown = require('../index').shutdown,
    moment = require('moment'),
    timezone = require('moment-timezone'),
    port = 8080;

describe('Start server', function() {
        before(function() {
                boot();
        });
});

describe('Api status', function() {
        it('should respond to get', function() {
                unirest.get('http://localhost:' + port + '/schedule').end(function(res) {
                        expect(res.status).to.equal(200);
                });
        });
        it('should say API OK', function() {
                unirest.get('http://localhost:' + port + '/schedule').end(function(res) {
                        expect(res.body).to.equal("API OK");
                });
        });
});

describe('Periods agree with letter days', function() {
        var startDate = moment('2015-08-27');
        var endDate = moment('2015-11-30');
        var dates = [];
        while(startDate.isBefore(endDate)) {
                dates.push(moment(startDate));
                startDate.add(1, 'day');
        }
        var count = 0;
        it('checks all dates', function(done) {
                dates.forEach(function(date, index) {
                        getDay(date, function(currentDay) {
                                count++;
                                if(currentDay != "No school") {
                                        expect(currentDay).to.not.be.undefined;
                                        expect(currentDay.length).to.be.above(5);
                                }
                                if(count == dates.length) {
                                        done();  
                                }
                        });
                });
        });
});

describe('Stop server', function() {
        after(function() {
                shutdown();
        }); 
});

function getDay(date, cb) {
        unirest.get('http://localhost:' + port + '/schedule/day_type?date=' + date.format("YYYY-MM-DD")).end(function(res) {
                if(res.body.date) {
                        var dayType = res.body.type;
                        unirest.get('http://localhost:' + port + '/schedule/all_periods?date=' + date.format("YYYY-MM-DD")).end(function(res2) {
                                cb(res2.body);
                });
                } else {
                        cb("No school");
                }
}); 
}

{'fraction_non_alphanumeric': 0.18548763415772282, 'fraction_numerical': 0.010499300046663556, 'mean_word_length': 1.6044957472660997, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2432045', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1192, 'n_words': 185}