File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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)' , ( ) => {
You can’t perform that action at this time.
0 commit comments