<commit_before>var should = require('should');
var sandboxPath = 'test/sandbox';
var fs = require('fs');

describe('Indexing numeric fields, Reuters: ', function(){
  it('should index one file of test data', function(done) {
    this.timeout(5000);
    var data = JSON.parse(fs.readFileSync('node_modules/reuters-21578-json/data/justTen/justTen.json'));
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10',
                                logLevel: 'warn'});
    var opt = {};
    opt.batchName = 'reuters';
    opt.filters = ['places', 'topics'];
    si.add(opt, data, function(err) {
      (err === null).should.be.exactly(true);
      si.close(function(err){done();})
    });
  }),
  it('verifies calibration of number after batch is indexed', function(done) {
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10',
                                logLevel: 'error'});
    si.indexValue({key:'TF~randomNumber~2749~~'}, function(err, value) {
      (err === null).should.be.exactly(true);
      value.length.should.be.exactly(1);
      si.close(function(err){done();})
    });
  }),
  it('should verify indexing', function(done) {
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10',
                                logLevel: 'error'});
    si.tellMeAboutMySearchIndex(function(info) {
      should.exist(info);
      (info.totalDocs).should.be.exactly(10);
      si.close(function(err){
        done();
      })
    });
  }),
  it('should be able to search number fields in indexed datas', function(done) {
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10',
                                logLevel: 'warn'});
    var q = {};
    q.query = {randomNumber: [2749]};
    si.search(q, function(err, results) {
      should.exist(results);
      (err === null).should.be.exactly(true);
      results.hits.length.should.be.exactly(1);
      results.hits[0].id.should.be.exactly('9');
      si.close(function(err){done();})
    });
  })
})<commit_msg>fixed tests<commit_after>var should = require('should');
var sandboxPath = 'test/sandbox';
var fs = require('fs');

describe('Indexing numeric fields, Reuters: ', function(){
  it('should index one file of test data', function(done) {
    this.timeout(5000);
    var data = JSON.parse(fs.readFileSync('node_modules/reuters-21578-json/data/justTen/justTen.json'));
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10-2',
                                logLevel: 'warn'});
    var opt = {};
    opt.batchName = 'reuters';
    opt.filters = ['places', 'topics'];
    si.add(opt, data, function(err) {
      (err === null).should.be.exactly(true);
      si.close(function(err){done();})
    });
  }),
  it('verifies calibration of number after batch is indexed', function(done) {
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10-2',
                                logLevel: 'error'});
    si.indexValue({key:'TF~randomNumber~2749~~'}, function(err, value) {
      (err === null).should.be.exactly(true);
      value.length.should.be.exactly(1);
      si.close(function(err){done();})
    });
  }),
  it('should verify indexing', function(done) {
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10-2',
                                logLevel: 'error'});
    si.tellMeAboutMySearchIndex(function(info) {
      should.exist(info);
      (info.totalDocs).should.be.exactly(10);
      si.close(function(err){
        done();
      })
    });
  }),
  it('should be able to search number fields in indexed datas', function(done) {
    var si = require('../../')({indexPath: sandboxPath + '/si-reuters-10-2',
                                logLevel: 'warn'});
    var q = {};
    q.query = {randomNumber: [2749]};
    si.search(q, function(err, results) {
      should.exist(results);
      (err === null).should.be.exactly(true);
      results.hits.length.should.be.exactly(1);
      results.hits[0].id.should.be.exactly('9');
      si.close(function(err){done();})
    });
  })
})
{'fraction_non_alphanumeric': 0.1943081452404318, 'fraction_numerical': 0.01619234543670265, 'mean_word_length': 2.6401785714285713, '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': '7139989', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1301, 'n_words': 235}