<commit_before>/* jshint expr: true, unused: false */
/* global describe, it, before, after, beforeEach, afterEach */

var async      = require('async')
  , mongoose   = require('mongoose')
  , cachegoose = require('../')
  , should     = require('should')
  , mongoose   = require('mongoose')
  , Schema     = mongoose.Schema
  , RecordSchema
  , Record
  , cache
  , db
  ;

describe('cachegoose', function() {
  before(function(done) {
    cachegoose(mongoose, {}, true);

    cache = cachegoose._cache;

    mongoose.connect('mongodb://127.0.0.1/mongoose-cachegoose-testing');
    db = mongoose.connection;

    db.on('error', done);
    db.on('open', done);

    RecordSchema = new Schema({
      num: Number,
      str: String,
      date: {
        type: Date,
        default: Date.now
      }
    });

    Record = mongoose.model('Record', RecordSchema);
  });

  beforeEach(function(done) {<commit_msg>Set mongoose.Promise to the native ES6 Promise<commit_after>/* jshint expr: true, unused: false */
/* global describe, it, before, after, beforeEach, afterEach */

var async      = require('async')
  , mongoose   = require('mongoose')
  , cachegoose = require('../')
  , should     = require('should')
  , mongoose   = require('mongoose')
  , Schema     = mongoose.Schema
  , RecordSchema
  , Record
  , cache
  , db
  ;

mongoose.Promise = global.Promise;

describe('cachegoose', function() {
  before(function(done) {
    cachegoose(mongoose, {}, true);

    cache = cachegoose._cache;

    mongoose.connect('mongodb://127.0.0.1/mongoose-cachegoose-testing');
    db = mongoose.connection;

    db.on('error', done);
    db.on('open', done);

    RecordSchema = new Schema({
      num: Number,
      str: String,
      date: {
        type: Date,
        default: Date.now
      }
    });

    Record = mongoose.model('Record', RecordSchema);
  });

  beforeEach(function(done) {
{'fraction_non_alphanumeric': 0.15478077126254622, 'fraction_numerical': 0.006867406233491812, 'mean_word_length': 2.834008097165992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1012838', 'n_tokens_mistral': 624, 'n_tokens_neox': 625, 'n_words': 128}