@@ -131,7 +131,8 @@ describe("update", () => {
131131
132132 await expect ( settings ( ) . read ( ) ) . resolves . toEqual ( { update } )
133133 expect ( isNaN ( update . checked ) ) . toEqual ( false )
134- expect ( update . checked < Date . now ( ) && update . checked >= now ) . toEqual ( true )
134+ expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
135+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
135136 expect ( update . version ) . toStrictEqual ( "2.1.0" )
136137 expect ( spy ) . toEqual ( [ "/latest" ] )
137138 } )
@@ -145,7 +146,7 @@ describe("update", () => {
145146
146147 await expect ( settings ( ) . read ( ) ) . resolves . toEqual ( { update } )
147148 expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
148- expect ( update . checked ) . toBeLessThan ( now )
149+ expect ( update . checked ) . toBeLessThanOrEqual ( now )
149150 expect ( update . version ) . toStrictEqual ( "2.1.0" )
150151 expect ( spy ) . toEqual ( [ ] )
151152 } )
@@ -160,7 +161,7 @@ describe("update", () => {
160161 await expect ( settings ( ) . read ( ) ) . resolves . toEqual ( { update } )
161162 expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
162163 expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
163- expect ( update . checked ) . toBeLessThan ( Date . now ( ) )
164+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
164165 expect ( update . version ) . toStrictEqual ( "4.1.1" )
165166 expect ( spy ) . toStrictEqual ( [ "/latest" ] )
166167 } )
@@ -206,15 +207,15 @@ describe("update", () => {
206207 let update = await provider . getUpdate ( true )
207208 expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
208209 expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
209- expect ( update . checked ) . toBeLessThan ( Date . now ( ) )
210+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
210211 expect ( update . version ) . toStrictEqual ( "unknown" )
211212
212213 provider = new UpdateProvider ( "http://probably.invalid.dev.localhost/latest" , settings ( ) )
213214 now = Date . now ( )
214215 update = await provider . getUpdate ( true )
215216 expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
216217 expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
217- expect ( update . checked ) . toBeLessThan ( Date . now ( ) )
218+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
218219 expect ( update . version ) . toStrictEqual ( "unknown" )
219220 } )
220221
0 commit comments