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