Skip to content

Commit dc24136

Browse files
committed
test(time): verify behavior for invalid timezone identifiers
1 parent b7031f5 commit dc24136

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

utils/time.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,10 @@ describe('getSecondsUntilMidnightInTimezone — extreme timezone offset boundary
282282

283283
expect(getSecondsUntilMidnightInTimezone('Pacific/Midway')).toBe(86400);
284284
});
285+
286+
it('throws a RangeError for invalid timezone identifiers', () => {
287+
vi.setSystemTime(new Date('2024-06-15T12:00:00.000Z'));
288+
289+
expect(() => getSecondsUntilMidnightInTimezone('Invalid/Timezone')).toThrow(RangeError);
290+
});
285291
});

0 commit comments

Comments
 (0)