import { absoluteDate } from './index' describe('formatting - universalDate', () => { const daylightSavingDateTime = '2021-02-28T00:00:00.000Z' // UTC const standardDateTime = '2021-07-31T00:00:00.000Z' // UTC it.each([ ['America/Phoenix', 'en-US', '2/27/2021'], ['America/Chicago', 'en-US', '2/27/2021'], ['America/New_York', 'en-US', '2/27/2021'], ['America/Montevideo', 'es-UY', '2/27/2021'], ['America/Sao_Paulo', 'pt-BR', '2/27/2021'], ['UTC', 'en-US', '2/28/2021'], ['UTC', 'en-GB', '2/28/2021'], ['Europe/London', 'en-GB', '2/28/2021'], ['Europe/Paris', 'fr-FR', '2/28/2021'], ['Asia/Tbilisi', 'ka-GE', '2/28/2021'], ['Asia/Kolkata', 'hi-IN', '2/28/2021'], ])( 'daylightSavingDateTime - returns a string formatted for the TZ and Locale (TZ: %s, Locale: %s)', (timezone, locale, localisedResult) => expect( absoluteDate(daylightSavingDateTime, { timezone, locale }) ).toEqual(localisedResult) ) it.each([ ['America/Phoenix', 'en-US', '7/30/2021'], ['America/Chicago', 'en-US', '7/30/2021'], ['America/New_York', 'en-US', '7/30/2021'], ['America/Montevideo', 'es-UY', '7/30/2021'], ['America/Sao_Paulo', 'pt-BR', '7/30/2021'], ['UTC', 'en-US', '7/31/2021'], ['UTC', 'en-GB', '7/31/2021'], ['Europe/London', 'en-GB', '7/31/2021'], ['Europe/Paris', 'fr-FR', '7/31/2021'], ['Asia/Tbilisi', 'ka-GE', '7/31/2021'], ['Asia/Kolkata', 'hi-IN', '7/31/2021'], ])( 'standardDateTime - returns a string formatted for the TZ and Locale (TZ: %s, Locale: %s)', (timezone, locale, localisedResult) => expect(absoluteDate(standardDateTime, { timezone, locale })).toEqual( localisedResult ) ) })