@@ -5,7 +5,6 @@ const { deepStrictEqual, notEqual, equal } = require('node:assert')
55const { Readable } = require ( 'node:stream' )
66const { once } = require ( 'node:events' )
77const MemoryCacheStore = require ( '../../lib/cache/memory-cache-store' )
8- const { nowAbsolute } = require ( '../../lib/util/timers.js' )
98
109cacheStoreTests ( MemoryCacheStore )
1110
@@ -33,9 +32,9 @@ function cacheStoreTests (CacheStore) {
3332 statusCode : 200 ,
3433 statusMessage : '' ,
3534 rawHeaders : [ Buffer . from ( '1' ) , Buffer . from ( '2' ) , Buffer . from ( '3' ) ] ,
36- cachedAt : nowAbsolute ( ) ,
37- staleAt : nowAbsolute ( ) + 10000 ,
38- deleteAt : nowAbsolute ( ) + 20000
35+ cachedAt : Date . now ( ) ,
36+ staleAt : Date . now ( ) + 10000 ,
37+ deleteAt : Date . now ( ) + 20000
3938 }
4039 const requestBody = [ 'asd' , '123' ]
4140
@@ -73,9 +72,9 @@ function cacheStoreTests (CacheStore) {
7372 statusCode : 200 ,
7473 statusMessage : '' ,
7574 rawHeaders : [ Buffer . from ( '1' ) , Buffer . from ( '2' ) , Buffer . from ( '3' ) ] ,
76- cachedAt : nowAbsolute ( ) ,
77- staleAt : nowAbsolute ( ) + 10000 ,
78- deleteAt : nowAbsolute ( ) + 20000
75+ cachedAt : Date . now ( ) ,
76+ staleAt : Date . now ( ) + 10000 ,
77+ deleteAt : Date . now ( ) + 20000
7978 }
8079 const anotherBody = [ 'asd2' , '1234' ]
8180
@@ -111,9 +110,9 @@ function cacheStoreTests (CacheStore) {
111110 statusCode : 200 ,
112111 statusMessage : '' ,
113112 rawHeaders : [ Buffer . from ( '1' ) , Buffer . from ( '2' ) , Buffer . from ( '3' ) ] ,
114- cachedAt : nowAbsolute ( ) - 10000 ,
115- staleAt : nowAbsolute ( ) - 1 ,
116- deleteAt : nowAbsolute ( ) + 20000
113+ cachedAt : Date . now ( ) - 10000 ,
114+ staleAt : Date . now ( ) - 1 ,
115+ deleteAt : Date . now ( ) + 20000
117116 }
118117 const requestBody = [ 'part1' , 'part2' ]
119118
@@ -144,9 +143,9 @@ function cacheStoreTests (CacheStore) {
144143 const requestValue = {
145144 statusCode : 200 ,
146145 statusMessage : '' ,
147- cachedAt : nowAbsolute ( ) - 20000 ,
148- staleAt : nowAbsolute ( ) - 10000 ,
149- deleteAt : nowAbsolute ( ) - 5
146+ cachedAt : Date . now ( ) - 20000 ,
147+ staleAt : Date . now ( ) - 10000 ,
148+ deleteAt : Date . now ( ) - 5
150149 }
151150 const requestBody = [ 'part1' , 'part2' ]
152151
@@ -178,9 +177,9 @@ function cacheStoreTests (CacheStore) {
178177 vary : {
179178 'some-header' : 'hello world'
180179 } ,
181- cachedAt : nowAbsolute ( ) ,
182- staleAt : nowAbsolute ( ) + 10000 ,
183- deleteAt : nowAbsolute ( ) + 20000
180+ cachedAt : Date . now ( ) ,
181+ staleAt : Date . now ( ) + 10000 ,
182+ deleteAt : Date . now ( ) + 20000
184183 }
185184 const requestBody = [ 'part1' , 'part2' ]
186185
0 commit comments