import { isBefore } from './index' describe('comparisons - isBefore', () => { it.each([ // is 'subjectDate' before 'otherDate' ['2021-01-01T00:02:00.000Z', '2021-01-01T00:01:00.000Z', false], ['2021-01-01T00:01:00.000Z', '2021-01-01T00:01:01.000Z', false], ['2021-01-01T00:01:00.000Z', '2021-01-01T00:01:00.000Z', false], ['2021-01-01T00:01:00.000Z', '2021-01-01T00:01:30.000Z', false], ['2021-01-01T00:01:00.000Z', '2021-01-01T00:02:00.000Z', true], ['2021-01-01T00:01:00.000Z', '2021-01-01T01:01:00.000Z', true], ['2021-01-01T00:01:00.000Z', '2021-01-02T00:01:00.000Z', true], ])( 'should determine if a date=%s is before %s, expected=%s', (subjectDateString, otherDateString, expected) => expect( isBefore(subjectDateString, otherDateString, { locale: 'en-US', timezone: 'UTC', }) ).toBe(expected) ) })