<commit_before>describe('IDBWrapper', function(){

  describe('delete databases', function(){
    var store;

    before(function(done){
      store = new IDBStore({
        storeName: 'spec-store-simple'
      }, done);
    });

    it('should delete the newly created database', function(done){
      store.deleteDatabase(function(result){
        expect(result).to.be.ok;
        done();
      }, done);
    });

  });

  describe('basic CRUD, in-line keys', function(){

    var store;

    before(function(done){
      store = new IDBStore({
        storeName: 'spec-store-simple'
      }, done);
    });


    it('should store a well-formed object', function(done){
      var data = {
        id: 1,
        name: 'John'
      };
      store.put(data, function(insertId){
        expect(insertId).to.equal(data.id);
        done();
      }, done);
    });

    it('should fetch a stored object', function(done){
      store.get(1, function(data){
        expect(data.name).to.equal('John');
        done();
      }, done);
    });

    it('should overwrite a given object', function(done){
      var data = {
        id: 1,
        name: 'James'
      };
      store.put(data, function(insertId){
        store.get(1, function(data){
          expect(data.name).to.equal('James');
          done();
        }, done);
      }, done);
    });

    it('should store an object w/o an id', function(done){
      var data = {
        name: 'Joe'
      };
      store.put(data, function(insertId){
        expect(insertId).to.exist;
        store.get(insertId, function(result){
          expect(result.name).to.equal(data.name);
          done();
        }, done);
      }, done);
    });

    it('should get all stored objects', function(done){
      store.getAll(function(data){
        expect(data.length).to.equal(2);
        done();
      }, done);
    });

    it('should delete a given object', function(done){
      store.remove(1, function(result){
        store.get(1, function(data){
          expect(data).to.not.exist;
          done();
        }, done);
      }, done);
    });

    it('should clear all objects', function(done){
      store.clear(function(){
        store.getAll(function(data){
          expect(data.length).to.equal(0);
        }, done);
        done();
      }, done);
    });


    after(function(done){
      store.clear(function(){
        done();
      });
    });<commit_msg>Add dedicated autoIncrement test<commit_after>describe('IDBWrapper', function(){

  describe('delete databases', function(){
    var store;

    before(function(done){
      store = new IDBStore({
        storeName: 'spec-store-simple'
      }, done);
    });

    it('should delete the newly created database', function(done){
      store.deleteDatabase(function(result){
        expect(result).to.be.ok;
        done();
      }, done);
    });

  });

  describe('basic CRUD, in-line keys', function(){

    var store, lastInsertId;

    before(function(done){
      store = new IDBStore({
        storeName: 'spec-store-simple'
      }, done);
    });


    it('should store a well-formed object', function(done){
      var data = {
        id: 1,
        name: 'John'
      };
      store.put(data, function(insertId){
        expect(insertId).to.equal(data.id);
        done();
      }, done);
    });

    it('should fetch a stored object', function(done){
      store.get(1, function(data){
        expect(data.name).to.equal('John');
        done();
      }, done);
    });

    it('should overwrite a given object', function(done){
      var data = {
        id: 1,
        name: 'James'
      };
      store.put(data, function(insertId){
        store.get(1, function(data){
          expect(data.name).to.equal('James');
          done();
        }, done);
      }, done);
    });

    it('should store an object w/o an id', function(done){
      var data = {
        name: 'Joe'
      };
      store.put(data, function(insertId){
        expect(insertId).to.exist;
        lastInsertId = insertId;
        store.get(insertId, function(result){
          expect(result.name).to.equal(data.name);
          done();
        }, done);
      }, done);
    });

    it('should assign an id which is greater than the last assigned', function(done){
      var data = {
        name: 'John'
      };
      store.put(data, function(insertId){
        expect(insertId).to.exist;
        expect(store.idb.cmp(insertId, lastInsertId)).to.equal(1);
        done();
      }, done);
    });

    it('should get all stored objects', function(done){
      store.getAll(function(data){
        expect(data.length).to.equal(3);
        done();
      }, done);
    });

    it('should delete a given object', function(done){
      store.remove(1, function(result){
        store.get(1, function(data){
          expect(data).to.not.exist;
          done();
        }, done);
      }, done);
    });

    it('should clear all objects', function(done){
      store.clear(function(){
        store.getAll(function(data){
          expect(data.length).to.equal(0);
        }, done);
        done();
      }, done);
    });


    after(function(done){
      store.clear(function(){
        done();
      });
    });
{'fraction_non_alphanumeric': 0.16449386503067484, 'fraction_numerical': 0.00325920245398773, 'mean_word_length': 2.0580304806565066, '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': '5865852', 'n_tokens_mistral': 1586, 'n_tokens_neox': 1534, 'n_words': 321}