@@ -131,7 +131,8 @@ describe("update", () => {
131
131
132
132
await expect ( settings ( ) . read ( ) ) . resolves . toEqual ( { update } )
133
133
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 ( ) )
135
136
expect ( update . version ) . toStrictEqual ( "2.1.0" )
136
137
expect ( spy ) . toEqual ( [ "/latest" ] )
137
138
} )
@@ -145,7 +146,7 @@ describe("update", () => {
145
146
146
147
await expect ( settings ( ) . read ( ) ) . resolves . toEqual ( { update } )
147
148
expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
148
- expect ( update . checked ) . toBeLessThan ( now )
149
+ expect ( update . checked ) . toBeLessThanOrEqual ( now )
149
150
expect ( update . version ) . toStrictEqual ( "2.1.0" )
150
151
expect ( spy ) . toEqual ( [ ] )
151
152
} )
@@ -160,7 +161,7 @@ describe("update", () => {
160
161
await expect ( settings ( ) . read ( ) ) . resolves . toEqual ( { update } )
161
162
expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
162
163
expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
163
- expect ( update . checked ) . toBeLessThan ( Date . now ( ) )
164
+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
164
165
expect ( update . version ) . toStrictEqual ( "4.1.1" )
165
166
expect ( spy ) . toStrictEqual ( [ "/latest" ] )
166
167
} )
@@ -206,15 +207,15 @@ describe("update", () => {
206
207
let update = await provider . getUpdate ( true )
207
208
expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
208
209
expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
209
- expect ( update . checked ) . toBeLessThan ( Date . now ( ) )
210
+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
210
211
expect ( update . version ) . toStrictEqual ( "unknown" )
211
212
212
213
provider = new UpdateProvider ( "http://probably.invalid.dev.localhost/latest" , settings ( ) )
213
214
now = Date . now ( )
214
215
update = await provider . getUpdate ( true )
215
216
expect ( isNaN ( update . checked ) ) . toStrictEqual ( false )
216
217
expect ( update . checked ) . toBeGreaterThanOrEqual ( now )
217
- expect ( update . checked ) . toBeLessThan ( Date . now ( ) )
218
+ expect ( update . checked ) . toBeLessThanOrEqual ( Date . now ( ) )
218
219
expect ( update . version ) . toStrictEqual ( "unknown" )
219
220
} )
220
221
0 commit comments