Skip to content

Commit aceab3e

Browse files
committed
fix:fixed identation and applied assertion to lock in expected rounding behavior
Signed-off-by: Himanshujha7 <tigmanshujah@gmail.com>
1 parent c75f696 commit aceab3e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

utils/time.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ describe('getSecondsUntilUTCMidnight', () => {
6767
it('always returns an integer with sub-second precision input', () => {
6868
vi.setSystemTime(new Date('2024-06-15T23:59:59.999Z'));
6969

70-
expect(Number.isInteger(getSecondsUntilUTCMidnight())).toBe(true);
70+
const result = getSecondsUntilUTCMidnight();
71+
expect(Number.isInteger(result)).toBe(true);
72+
expect(result).toBe(0);
7173
});
7274

7375
});
@@ -153,10 +155,12 @@ describe('getSecondsUntilMidnightInTimezone', () => {
153155
});
154156

155157
it('always returns an integer with sub-second precision input', () => {
156-
// 2024-06-16T03:59:59.999Z is 23:59:59.999 in Etc/GMT+4 (UTC-4)
158+
// 2024-06-16T03:59:59.999Z is 23:59:59.999 in Etc/GMT+4 (UTC-4)
157159
vi.setSystemTime(new Date('2024-06-16T03:59:59.999Z'));
158160

159-
expect(Number.isInteger(getSecondsUntilMidnightInTimezone('Etc/GMT+4'))).toBe(true);
161+
const result = getSecondsUntilMidnightInTimezone('Etc/GMT+4');
162+
expect(Number.isInteger(result)).toBe(true);
163+
expect(result).toBe(0);
160164
});
161165

162166
it('handles extreme timezone Etc/GMT-14 (UTC+14)', () => {

0 commit comments

Comments
 (0)