<commit_before>describe("Delta objects", function(done) {
  var th = require('../timehaze.js');
  var ts = new Date();
  var evt = new Date(ts.getTime() - 9000);

  beforeEach(function(done){
    th.update();
    done();
  });

  afterEach(function(){
    th.stopUpdate();
  });

  it("should be non updatable by default", function(done) {
    var dx = th.delta(evt, ts);
    var old = dx.ago();
    var updated;
    setTimeout(function(){
      updated = dx.ago();
      expect(updated).toBe(old);
      done();
      }, 3000);
  });

  it("should be updatable", function(done) {
    var dx = th.delta(evt, ts, true);
    var old = dx.ago();
    var updated;
    setTimeout(function(){
      updated = dx.ago();
      expect(updated).not.toBe(old);
      done();
      }, 3000);
  });

  it("should be updatable at a custom frequency", function(done) {
    th.update(2000);
    var dx = th.delta(evt, ts, true);
    var old = dx.ago();
    var updated;
    setTimeout(function(){
      updated = dx.ago();
      expect(updated).not.toBe(old);<commit_msg>Add new spec (forgot)<commit_after>describe("Delta objects", function(done) {
  var th = require('../timehaze.js');
  var ts = new Date();
  var evt = new Date(ts.getTime() - 9000);

  beforeEach(function(done){
    th.update();
    done();
  });

  afterEach(function(){
    th.stopUpdate();
  });

  it("should be non updatable by default", function(done) {
    var dx = th.delta(evt, ts);
    var old = dx.ago();
    var updated;
    setTimeout(function(){
      updated = dx.ago();
      expect(updated).toBe(old);
      done();
      }, 3000);
  });

  it("should be updatable if specified in the constructor", function(done) {
    var dx = th.delta(evt, ts, true);
    var old = dx.ago();
    var updated;
    setTimeout(function(){
      updated = dx.ago();
      expect(updated).not.toBe(old);
      done();
      }, 3000);
  });

  it("should be updatable if specified after construction", function(done) {
      var dx = th.delta(evt, ts);
      dx.updatable(true);
      var old = dx.ago();
      var updated;
      setTimeout(function(){
          updated = dx.ago();
          expect(updated).not.toBe(old);
          done();
      }, 3000);
  });

  it("should be updatable at a custom frequency", function(done) {
    th.update(2000);
    var dx = th.delta(evt, ts, true);
    var old = dx.ago();
    var updated;
    setTimeout(function(){
      updated = dx.ago();
      expect(updated).not.toBe(old);
{'fraction_non_alphanumeric': 0.17185604528912252, 'fraction_numerical': 0.014557217953902144, 'mean_word_length': 2.627565982404692, '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': '4711839', 'n_tokens_mistral': 833, 'n_tokens_neox': 795, 'n_words': 201}