<commit_before>import {expect} from 'chai';
import * as DateFaker from '../../lib/faker/date';

describe('#Date', () => {
  describe('#between', () => {
    it('should return a Date', () => {
      expect(DateFaker.between(new Date(), new Date())).to.be.a('Date');
    });

    it('should handle string dates', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);
      expect(DateFaker.between('2017-01-01', '2017-01-10')).to.be.within(from, to);
    });
  });

  describe('#betweenExcept', () => {
    it('should return a Date', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);
      const except = new Date(2017, 0, 5);
      expect(DateFaker.betweenExcept(from, to, except)).to.be.a('Date');
    });

    it('should handle string dates', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);
      expect(DateFaker.betweenExcept('2017-01-01', '2017-01-10', '2017-01-04')).to.be.within(from, to);
    });
  });

  describe('#forward', () => {
    it('should return a Date', () => {
      expect(DateFaker.forward(10)).to.be.a('Date');
    });
  });

  describe('#backward', () => {
    it('should return a Date', () => {
      expect(DateFaker.backward(10)).to.be.a('Date');
    });
  });
<commit_msg>Added test to make sure we are returning a date inbetween two dates.<commit_after>import {expect} from 'chai';
import * as DateFaker from '../../lib/faker/date';

describe('#Date', () => {
  describe('#between', () => {
    it('should return a Date', () => {
      expect(DateFaker.between(new Date(), new Date())).to.be.a('Date');
    });

    it('should handle string dates', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);
      expect(DateFaker.between('2017-01-01', '2017-01-10')).to.be.within(from, to);
    });

    it('should return a date between two dates', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);

      [...Array(100).keys()].forEach(_ => {
        expect(DateFaker.between(from, to)).to.be.within(from, to);
      });
    });
  });

  describe('#betweenExcept', () => {
    it('should return a Date', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);
      const except = new Date(2017, 0, 5);
      expect(DateFaker.betweenExcept(from, to, except)).to.be.a('Date');
    });

    it('should handle string dates', () => {
      const from = new Date(2017, 0, 1);
      const to = new Date(2017, 0, 10);
      expect(DateFaker.betweenExcept('2017-01-01', '2017-01-10', '2017-01-04')).to.be.within(from, to);
    });
  });

  describe('#forward', () => {
    it('should return a Date', () => {
      expect(DateFaker.forward(10)).to.be.a('Date');
    });
  });

  describe('#backward', () => {
    it('should return a Date', () => {
      expect(DateFaker.backward(10)).to.be.a('Date');
    });
  });

{'fraction_non_alphanumeric': 0.2233502538071066, 'fraction_numerical': 0.06565143824027073, 'mean_word_length': 2.833981841763943, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 27, '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': '1516405', 'n_tokens_mistral': 1161, 'n_tokens_neox': 999, 'n_words': 227}