<commit_before>var should = require('should');
var opening = require('../lib/opening');
var day = require('../lib/tools/millis').day;

/*global describe, it*/


function iso(millis) {
  var date = new Date(millis);
  return date.toISOString().slice(0, 10);
}

var now = Date.now();
var today = iso(now);
var future = iso(now + 2 * day);
var past = iso(now - 2 * day);

describe('opening', function() {
  it('should be empty for missing dates', function(done) {
    opening({}, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be empty for invalid dates', function(done) {
    opening({
      opening: 'abc'
    }, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be empty for past dates', function(done) {
    opening({
      opening: past
    }, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be empty for past dates', function(done) {
    opening({
      opening: today
    }, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be present for future dates', function(done) {
    opening({
      opening: future
    }, function(err, od) {
      should.exist(od);
      od.should.eql(future);
      done(err);
    });
  });
});<commit_msg>Fixed opening date test after certain time<commit_after>var should = require('should');
var opening = require('../lib/opening');
var day = require('../lib/tools/millis').day;

/*global describe, it*/


function iso(millis) {
  var date;
  millis -= (new Date().getTimezoneOffset()) * 60 * 1000;
  date = new Date(millis);
  return date.toISOString().slice(0, 10);
}

var now = Date.now();
var today = iso(now);
var future = iso(now + 2 * day);
var past = iso(now - 2 * day);

describe('opening', function() {
  it('should be empty for missing dates', function(done) {
    opening({}, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be empty for invalid dates', function(done) {
    opening({
      opening: 'abc'
    }, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be empty for past dates', function(done) {
    opening({
      opening: past
    }, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be empty for today', function(done) {
    opening({
      opening: today
    }, function(err, od) {
      should.not.exist(od);
      done(err);
    });
  });

  it('should be present for future dates', function(done) {
    opening({
      opening: future
    }, function(err, od) {
      should.exist(od);
      od.should.eql(future);
      done(err);
    });
  });
});
{'fraction_non_alphanumeric': 0.17977941176470588, 'fraction_numerical': 0.0058823529411764705, 'mean_word_length': 2.7427785419532325, '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': '6388332', 'n_tokens_mistral': 923, 'n_tokens_neox': 884, 'n_words': 227}