<commit_before>var boot = require('../../app').boot,
    shutdown = require('../../app').shutdown,
    port = require('../../app').port,
    models = require('../../models'),
    environment = require('./../test_environment'),
    superagent = require('superagent'),
    expect = require('expect.js'),
    moment = require('moment');

describe('Server', function () {
  before(function () {
    boot();
    environment.cleanDb();
  });
  describe('Homepage', function () {
    before(function () {
      environment.createTaskWithTimeLog();
    })
    it('should respond to GET', function (done) {
      superagent
        .get('http://localhost:' + port + '/tasks')
        .end(function (res) {
          expect(res.status).to.equal(200);
          done();
        });
    });
    it('should return a task when responding to GET', function (done) {
      superagent
        .get('http://localhost:' + port + '/tasks')
        .end(function (res) {
          var tasks = res.body.tasks;
          expect(tasks).to.have.length(1);
          expect(tasks[0]).to.have.keys('name', 'description', 'status', 'logs');
          done();
        });
    });
  });
  after(function () {
    shutdown();
  });
});<commit_msg>Added more assertions.<commit_after>var boot = require('../../app').boot,
    shutdown = require('../../app').shutdown,
    port = require('../../app').port,
    models = require('../../models'),
    environment = require('./../test_environment'),
    superagent = require('superagent'),
    expect = require('expect.js'),
    moment = require('moment');

describe('Server', function () {
  before(function () {
    boot();
    environment.cleanDb();
  });
  describe('Homepage', function () {
    before(function () {
      environment.createTaskWithTimeLog();
    })
    it('should respond to GET', function (done) {
      superagent
        .get('http://localhost:' + port + '/tasks')
        .end(function (res) {
          expect(res.status).to.equal(200);
          done();
        });
    });
    it('should return a task when responding to GET', function (done) {
      superagent
        .get('http://localhost:' + port + '/tasks')
        .end(function (res) {
          var tasks = res.body.tasks;
          expect(tasks).to.have.length(1);
          expect(tasks[0]).to.have.keys('name', 'description', 'status', 'logs');
          expect(tasks[0].logs).to.have.length(1);
          expect(tasks[0].logs[0]).to.have.keys('startedAt', 'stopedAt', 'task');
          done();
        });
    });
  });
  after(function () {
    shutdown();
  });
});
{'fraction_non_alphanumeric': 0.2062937062937063, 'fraction_numerical': 0.005439005439005439, 'mean_word_length': 2.3970976253298155, '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': '2326871', 'n_tokens_mistral': 746, 'n_tokens_neox': 737, 'n_words': 140}