import { isSame } from './index' describe('comparisons - isSame', () => { it.each([ // is 'subjectDate' same as 'otherDate' ['2020-12-31T23:59:59.000Z', '2021-01-01T00:00:00.000Z', false], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:00:00.000Z', true], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:00:00.001Z', true], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:00:01.000Z', true], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:00:30.000Z', true], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:00:59.000Z', true], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:00:59.999Z', true], ['2021-01-01T00:00:00.000Z', '2021-01-01T00:01:00.000Z', false], ])( 'should determine if a date=%s is same as %s, expected=%s', (subjectDateString, otherDateString, expected) => expect( isSame(subjectDateString, otherDateString, { locale: 'en-US', timezone: 'UTC', }) ).toBe(expected) ) })