text: const moment = require('moment');
  const datetime = require('./../dist');
  
  describe('isValid*(', () => {
    it('should be valid', () => {
      const date = new Date('2017-02-01T00:00:00.000Z');
  
      expect(moment(date).isValid()).toEqual(true);
      expect(datetime(date).isValid()).toEqual(true);
    });
  
    it('should not be valid', () => {
      const date = new Date('wrong');
  
      expect(moment(date).isValid()).toEqual(false);
      expect(datetime(date).isValid()).toEqual(false);
    });
  
    const dates = [
      new Date('2017-01-01T00:00:00.000Z'),
      new Date('2017-05-26T21:21:34.381Z'),
      new Date('2018-01-01T00:00:00.000Z'),
      new Date('2018-01-01T23:00:00.000Z'),
      new Date('2019-01-01T00:00:00.000Z'),
      new Date('2019-12-31T23:59:59.999Z'),
      new Date('2019-12-31T00:00:00.000Z'),
      new Date('2020-11-30T23:59:59.999Z'),
      new Date('2020-11-30T00:00:00.000Z'),
      new Date('2021-04-30T23:59:59.999Z'),
      new Date('2021-04-01T23:59:59.999Z'),
      new Date('2021-04-01T00:00:00.000Z'),
      new Date('2020-03-23T00:00:00.000Z'),
      new Date('2020-03-31T00:00:00.000Z'),
      new Date('2020-10-23T00:00:00.000Z'),
      new Date('2020-10-31T00:00:00.000Z'),
      new Date('2021-03-23T00:00:00.000Z'),
      new Date('2021-03-31T00:00:00.000Z'),
      new Date('2021-10-23T00:00:00.000Z'),
      new Date('2021-10-31T00:00:00.000Z'),
      new Date('2020-03-23T23:59:59.999Z'),
      new Date('2020-03-31T23:59:59.999Z'),
      new Date('2020-10-23T23:59:59.999Z'),
      new Date('2020-10-31T23:59:59.999Z'),
      new Date('2021-03-23T23:59:59.999Z'),
      new Date('2021-03-31T23:59:59.999Z'),
      new Date('2021-10-23T23:59:59.999Z'),
      new Date('2021-10-31T23:59:59.999Z'),
  
      new Date(2017, 0, 1, 0, 0, 0, 0),
      new Date(2017, 4, 26, 21, 21, 34, 381),
      new Date(2018, 0, 1, 0, 0, 0, 0),
      new Date(2018, 0, 1, 23, 0, 0, 0),
      new Date(2019, 0, 1, 0, 0, 0, 0),
      new Date(2019, 11, 31, 23, 59, 59, 999),
      new Date(2019, 11, 31, 0, 0, 0, 0),
      new Date(2020, 10, 30, 23, 59, 59, 999),
      new Date(2020, 10, 30, 0, 0, 0, 0),
      new Date(2021, 3, 30, 23, 59, 59, 999),
      new Date(2021, 3, 1, 23, 59, 59, 999),
      new Date(2021, 3, 1, 0, 0, 0, 0),
      new Date(2020, 2, 23, 0, 0, 0, 0),
      new Date(2020, 2, 31, 0, 0, 0, 0),
      new Date(2020, 9, 23, 0, 0, 0, 0),
      new Date(2020, 9, 31, 0, 0, 0, 0),
      new Date(2021, 2, 23, 0, 0, 0, 0),
      new Date(2021, 2, 31, 0, 0, 0, 0),
      new Date(2021, 9, 23, 0, 0, 0, 0),
      new Date(2021, 9, 31, 0, 0, 0, 0),
      new Date(2020, 2, 23, 23, 59, 59, 999),
      new Date(2020, 2, 31, 23, 59, 59, 999),
      new Date(2020, 9, 23, 23, 59, 59, 999),
      new Date(2020, 9, 31, 23, 59, 59, 999),
      new Date(2021, 2, 23, 23, 59, 59, 999),
      new Date(2021, 2, 31, 23, 59, 59, 999),
      new Date(2021, 9, 23, 23, 59, 59, 999),
      new Date(2021, 9, 31, 23, 59, 59, 999),
  
      new Date(Date.UTC(2017, 0, 1, 0, 0, 0, 0)),
      new Date(Date.UTC(2017, 4, 26, 21, 21, 34, 381)),
      new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 0)),
      new Date(Date.UTC(2018, 0, 1, 23, 0, 0, 0)),
      new Date(Date.UTC(2019, 0, 1, 0, 0, 0, 0)),
      new Date(Date.UTC(2019, 11, 31, 23, 59, 59, 999)),
      new Date(Date.UTC(2019, 11, 31, 0, 0, 0, 0)),
      new Date(Date.UTC(2020, 10, 30, 23, 59, 59, 999)),
      new Date(Date.UTC(2020, 10, 30, 0, 0, 0, 0)),
      new Date(Date.UTC(2021, 3, 30, 23, 59, 59, 999)),
      new Date(Date.UTC(2021, 3, 1, 23, 59, 59, 999)),
      new Date(Date.UTC(2021, 3, 1, 0, 0, 0, 0)),
      new Date(Date.UTC(2020, 2, 23, 0, 0, 0, 0)),
      new Date(Date.UTC(2020, 2, 31, 0, 0, 0, 0)),
      new Date(Date.UTC(2020, 9, 23, 0, 0, 0, 0)),
      new Date(Date.UTC(2020, 9, 31, 0, 0, 0, 0)),
      new Date(Date.UTC(2021, 2, 23, 0, 0, 0, 0)),
      new Date(Date.UTC(2021, 2, 31, 0, 0, 0, 0)),
      new Date(Date.UTC(2021, 9, 23, 0, 0, 0, 0)),
      new Date(Date.UTC(2021, 9, 31, 0, 0, 0, 0)),
      new Date(Date.UTC(2020, 2, 23, 23, 59, 59, 999)),
      new Date(Date.UTC(2020, 2, 31, 23, 59, 59, 999)),
      new Date(Date.UTC(2020, 9, 23, 23, 59, 59, 999)),
      new Date(Date.UTC(2020, 9, 31, 23, 59, 59, 999)),
      new Date(Date.UTC(2021, 2, 23, 23, 59, 59, 999)),
      new Date(Date.UTC(2021, 2, 31, 23, 59, 59, 999)),
      new Date(Date.UTC(2021, 9, 23, 23, 59, 59, 999)),
      new Date(Date.UTC(2021, 9, 31, 23, 59, 59, 999)),
  
      '2017-01-01T00:00:00.000Z',
      '2017-05-26T21:21:34.381Z',
      '2018-01-01T00:00:00.000Z',
      '2018-01-01T23:00:00.000Z',
      '2019-01-01T00:00:00.000Z',
      '2019-12-31T23:59:59.999Z',
      '2019-12-31T00:00:00.000Z',
      '2020-11-30T23:59:59.999Z',
      '2020-11-30T00:00:00.000Z',
      '2021-04-30T23:59:59.999Z',
      '2021-04-01T23:59:59.999Z',
      '2021-04-01T00:00:00.000Z',
      '2020-03-23T00:00:00.000Z',
      '2020-03-31T00:00:00.000Z',
      '2020-10-23T00:00:00.000Z',
      '2020-10-31T00:00:00.000Z',
      '2021-03-23T00:00:00.000Z',
      '2021-03-31T00:00:00.000Z',
      '2021-10-23T00:00:00.000Z',
      '2021-10-31T00:00:00.000Z',
      '2020-03-23T23:59:59.999Z',
      '2020-03-31T23:59:59.999Z',
      '2020-10-23T23:59:59.999Z',
      '2020-10-31T23:59:59.999Z',
      '2021-03-23T23:59:59.999Z',
      '2021-03-31T23:59:59.999Z',
      '2021-10-23T23:59:59.999Z',
      '2021-10-31T23:59:59.999Z'
    ];
  
    dates.map(date => {
      it(`should be valid with date ${
        typeof date === 'object'
          ? date.toISOString() + ' type date'
          : date + ' type string'
      } should verify`, () => {
        const expected = moment(date).isValid();
        const actual = datetime(date).isValid();
        expect(actual).toEqual(expected);
      });
  
      it(`utc: should be valid with date ${
        typeof date === 'object'
          ? date.toISOString() + ' type date'
          : date + ' type string'
      } should verify`, () => {
        const expected = moment.utc(date).isValid();
        const actual = datetime.utc(date).isValid();
        expect(actual).toEqual(expected);
      });
    });
  
    // Not active till this package shall not have the same output for for isValid() as the moment package
  
    // const dates2 = [
    //   new Date('wrong'),
    //   new Date('2021-10-wrong'),
    //   new Date('2021-13-31T23:59:59.999Z'),
    //   new Date('2021-02-31T23:59:59.999Z'),
    //   new Date('2021-02-31T24:59:59.999Z'),
    //   new Date('2021-02-31T23:69:59.999Z'),
    //   new Date('2021-02-31T23:59:69.999Z'),
  
    //   'wrong'
    //   '2021-10-wrong',
    //   '2021-13-31T23:59:59.999Z',
    //   '2021-02-31T23:59:59.999Z',
    //   '2021-02-31T24:59:59.999Z',
    //   '2021-02-31T23:69:59.999Z',
    //   '2021-02-31T23:59:69.999Z'
    // ];
  
    // dates2.map(date => {
    //   it(`should not be valid, input: ${date}`, () => {
    //     const expected = moment(date).isValid();
    //     const actual = datetime(date).isValid();
    //     expect(actual).toEqual(expected);
    //   });
  
    //   it(`utc: should not be valid, input: ${date}`, () => {
    //     const expected = moment.utc(date).isValid();
    //     const actual = datetime.utc(date).isValid();
    //     expect(actual).toEqual(expected);
    //   });
    // });
  });
  