Skip to content

Commit a1385ad

Browse files
dgp1130pkozlowski-opensource
authored andcommitted
test: remove unsupported timezone from formatDate tests
Removes the 'America/New_York' timezone string test case from `formatDate` tests because the underlying `Date.parse` API does not support IANA timezone strings. This caused the timezone calculation to silently fall back to the local executing machine's timezone, leading to non-deterministic test flakiness on Remote Build Execution (RBE) workers operating in varying geographic locations.
1 parent ecc616b commit a1385ad

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

packages/common/test/i18n/format_date_spec.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,13 +515,11 @@ describe('Format date', () => {
515515
it('should support timezones', () => {
516516
const isoDate = '2024-02-17T12:00:00Z';
517517

518-
const date1 = formatDate(isoDate, 'long', 'en', 'America/New_York');
519-
const date2 = formatDate(isoDate, 'long', 'en', 'EST');
520-
expect(date1).toBe('February 17, 2024, 12:00:00 PM GMT+0');
521-
expect(date2).toBe('February 17, 2024, 7:00:00 AM GMT-5');
518+
const dateEst = formatDate(isoDate, 'long', 'en', 'EST');
519+
expect(dateEst).toBe('February 17, 2024, 7:00:00 AM GMT-5');
522520

523-
const date3 = formatDate(isoDate, 'long', 'en', '+0500');
524-
expect(date3).toBe('February 17, 2024, 5:00:00 PM GMT+5');
521+
const dateOffset = formatDate(isoDate, 'long', 'en', '+0500');
522+
expect(dateOffset).toBe('February 17, 2024, 5:00:00 PM GMT+5');
525523
});
526524

527525
it('should return thursday date of the same week', () => {

0 commit comments

Comments
 (0)