1 import { formatIntlUTCDate } from '../../lib/date-utc/formatIntlUTCDate';
3 describe('formatIntlUTCDate()', () => {
4 it('formats UTC dates, not local dates', () => {
5 // The following test will pass in any machine with any local time zone (try it yourself!).
6 // Unfortunately there's no easy way of mocking local time zones with karma, so we can't make that explicit
7 const date = new Date(Date.UTC(2023, 5, 13, 17, 44, 2));
9 expect(formatIntlUTCDate(date, { timeStyle: 'short', hour12: false }, 'en-US')).toEqual('17:44');
10 expect(formatIntlUTCDate(date, { timeStyle: 'short', hour12: true }, 'fr-FR')).toEqual('05:44 PM');