<commit_before>'use strict';

var request = require('supertest');
var should = require('should');
var async = require('async');

var app = require('../app.js');
var config = require('../config/configuration.js');


describe('POST /hydrate API endpoint', function() {
  it('should refuse every request without a file', function(done) {
    request(app).post('/hydrate')
      .expect(405)
      .end(done);
  });

  it('should accept request with a file attached', function(done) {
    request(app).post('/hydrate')
      .attach('file', __filename)
      .expect(200)
      .end(done);
  });

  it('should respond with the correct informations', function(done) {
    request(app).post('/hydrate')
      .attach('file', __filename)
      .expect('Content-Type', /json/)
      .expect(200)
      .end(function(err, res) {
      var body =res.body;
      body.should.have.property('raw');
      body.should.have.property('html');
      body.should.have.property('content-encoding');

      done();
    });
  });
});
<commit_msg>Rewrite tests<commit_after>'use strict';

var request = require('supertest');
var should = require('should');
var async = require('async');

var app = require('../app.js');
var config = require('../config/configuration.js');


describe('POST /hydrate API endpoint', function() {
  it('should refuse every request without a file', function(done) {
    request(app).post('/hydrate')
      .expect(405)
      .end(done);
  });

  it('should accept request with a file attached', function(done) {
    request(app).post('/hydrate')
      .attach('file', __filename)
      .expect(200)
      .end(done);
  });

  it('should respond with the correct informations', function(done) {
    request(app).post('/hydrate')
      .attach('file', __filename)
      .expect('Content-Type', /json/)
      .expect(200)
      .end(function(err, res) {

      res.body.should.have.property('raw');
      res.body.should.have.property('html');
      res.body.should.have.property('content-encoding');

      done();
    });
  });
});

{'fraction_non_alphanumeric': 0.18458517427589594, 'fraction_numerical': 0.008836524300441826, 'mean_word_length': 3.2635983263598325, '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': '1725651', 'n_tokens_mistral': 642, 'n_tokens_neox': 608, 'n_words': 134}