import { checkNonISOFormats } from './datetime' describe('datetime - checkNonISOFormats', () => { it.each([ ['08-01-2024', '2024-08-01T00:00:00.000-04:00'], ['08/01/2024', '2024-08-01T00:00:00.000-04:00'], ['8/1/2024', '2024-08-01T00:00:00.000-04:00'], ['8/1/24', '2024-08-01T00:00:00.000-04:00'], ['01-08-2024', '2024-01-08T00:00:00.000-05:00'], ['01/08/2024', '2024-01-08T00:00:00.000-05:00'], ['1/8/2024', '2024-01-08T00:00:00.000-05:00'], ['1/8/24', '2024-01-08T00:00:00.000-05:00'], ['08-21-2024', '2024-08-21T00:00:00.000-04:00'], ['08/21/2024', '2024-08-21T00:00:00.000-04:00'], ['8/21/2024', '2024-08-21T00:00:00.000-04:00'], ['8/21/24', '2024-08-21T00:00:00.000-04:00'], ])( 'should return true for a valid non-ISO date string, date=%s, expected=%s', (input, expected) => expect( checkNonISOFormats(input, { locale: 'en-US', timezone: 'America/New_York', }) ).toEqual(expected) ) it('should throw an error for an invalid date string', () => expect(() => checkNonISOFormats('invalid', { locale: 'en-US', timezone: 'America/New_York', }) ).toThrow('Invalid date string: invalid')) })