<commit_before>'use strict';

/* global before, after */

var chai = require('chai');
chai.use(require('chai-as-promised'));
chai.should(); // var should = chai.should();

var Partitioner = require('../scripts/partitioner/sql'),
  utils = require('./utils'),
  DBMissingError = require('../scripts/client/db-missing-error');

describe('deltadb', function () {

  utils.setUp(this);

  before(function () {
// TODO: restore
//     // Create the db and only once for all the tests
//     var db = new Partitioner('testdb');
//     return db.connect().then(function () {
//       return db.closeDatabase(); // close as beforeEach will connect
//     }).catch(function (err) {
// console.log('err=', err);
// console.log('huh, db exists!!!');
// process.exit(1);
//       if (err instanceof DBMissingError) {
// console.log('&&&&&&&missing so create');
//         return db.createDatabase().then(function () {
//           return db.closeDatabase(); // close as beforeEach will connect
//         });
//       } else {
//         throw err;
//       }
//     });
  });

  after(function () {
// TODO: restore
    // // Destroy the db after all the tests
    // var db = new Partitioner('testdb');
    // return db.connect().then(function () {
    //   return db.destroyDatabase();
    // });
  });

  require('./spec');

  require('./e2e-no-socket');

});<commit_msg>restore testdb tests<commit_after>'use strict';

/* global before, after */

var chai = require('chai');
chai.use(require('chai-as-promised'));
chai.should(); // var should = chai.should();

var Partitioner = require('../scripts/partitioner/sql'),
  utils = require('./utils'),
  DBMissingError = require('../scripts/client/db-missing-error');

describe('deltadb', function () {

  utils.setUp(this);

  before(function () {
    // Create the db and only once for all the tests
    var db = new Partitioner('testdb');
    return db.createDatabase().then(function () {
      return db.closeDatabase(); // close as beforeEach will connect
    });
  });

//   before(function () {
// // TODO: restore
//     // Create the db and only once for all the tests
//     var db = new Partitioner('testdb');
//     return db.connect().then(function () {
//       return db.closeDatabase(); // close as beforeEach will connect
//     }).catch(function (err) {
//     console.log('err=', err);
//     console.log('huh, db exists!!!');
//     process.exit(1);
//       if (err instanceof DBMissingError) {
//     console.log('&&&&&&&missing so create');
//         return db.createDatabase().then(function () {
//           return db.closeDatabase(); // close as beforeEach will connect
//         });
//       } else {
//         throw err;
//       }
//     });
//   });

  after(function () {
    // Destroy the db after all the tests
    var db = new Partitioner('testdb');
    return db.connect().then(function () {
      return db.destroyDatabase();
    });
  });

  require('./spec');

  require('./e2e-no-socket');

});
{'fraction_non_alphanumeric': 0.1952284946236559, 'fraction_numerical': 0.0013440860215053765, 'mean_word_length': 2.531435349940688, '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': '5776743', 'n_tokens_mistral': 900, 'n_tokens_neox': 895, 'n_words': 216}