File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -234,12 +234,12 @@ describe("DynamoDBStore", () => {
234
234
} ) ;
235
235
236
236
it ( "should set correct expiry when expiresIn option is set" , async ( ) => {
237
+ const clock = sinon . useFakeTimers ( 1000000000 ) ;
237
238
const storeWithExpiry = new DynamoDBStore ( {
238
239
client : client ,
239
240
table : tableName ,
240
241
expiresIn : 1000
241
242
} ) ;
242
- const beforeTime = Math . floor ( Date . now ( ) / 1000 ) ;
243
243
244
244
await new Promise ( ( resolve , reject ) => {
245
245
storeWithExpiry . set (
@@ -263,8 +263,8 @@ describe("DynamoDBStore", () => {
263
263
) ;
264
264
265
265
const expiryValue = parseInt ( result . Item . expires . N ) ;
266
- const expectedExpiry = beforeTime + 1000 ;
267
- expiryValue . should . be . approximately ( expectedExpiry , 2 ) ;
266
+ expiryValue . should . equal ( 1000000 + 1000 ) ;
267
+ clock . restore ( ) ;
268
268
} ) ;
269
269
} ) ;
270
270
You can’t perform that action at this time.
0 commit comments