<commit_before>var assert = require('assert');

module.exports = function (cb) {
  var m;

  after(function () {
    if (cb) cb();
  });

  it('should not .find empty model from store', function (t) {
    m = new this.Model({});
    m.fetch({
      success: function () {
        t(new Error('should no success'));
      },
      error: function (model, err) {
        assert(err);
        t();
      }
    });
  });

  it('should not succeed index-fetching from an empty store', function (t) {
    if (!this.IndexedModel) return t();
    m = new this.IndexedModel({ some_id: 1 });
    m.fetch({
      success: function () {
        t(new Error('should not succeed'));
      },
      error: function (model, err) {
        t(err);
      }
    });
  });

  it('should include all the variables when saving a Model', function (t) {
    var Model = this.Model;
    m = new Model();
    m.save({
      variable: '123',
      counter: 1
    }, {
      success: function () {
        var m2 = new Model({
          id: m.get(m.idAttribute)
        });
        m2.fetch({<commit_msg>Correctly test an error fetching IndexedModel from an empty store<commit_after>var assert = require('assert');

module.exports = function (cb) {
  var m;

  after(function () {
    if (cb) cb();
  });

  it('should not .find empty model from store', function (t) {
    m = new this.Model({});
    m.fetch({
      success: function () {
        t(new Error('should no success'));
      },
      error: function (model, err) {
        assert(err);
        t();
      }
    });
  });

  it('should not succeed index-fetching from an empty store', function (t) {
    if (!this.IndexedModel) return t();
    m = new this.IndexedModel({ some_id: 1 });
    m.fetch({
      success: function () {
        t(new Error('should not succeed'));
      },
      error: function (model, err) {
        assert(err);
        t();
      }
    });
  });

  it('should include all the variables when saving a Model', function (t) {
    var Model = this.Model;
    m = new Model();
    m.save({
      variable: '123',
      counter: 1
    }, {
      success: function () {
        var m2 = new Model({
          id: m.get(m.idAttribute)
        });
        m2.fetch({
{'fraction_non_alphanumeric': 0.15706570657065708, 'fraction_numerical': 0.0063006300630063005, 'mean_word_length': 2.0577716643741404, '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': '6300223', 'n_tokens_mistral': 703, 'n_tokens_neox': 685, 'n_words': 207}