@@ -5,7 +5,6 @@ const { deepStrictEqual, notEqual, equal } = require('node:assert')
5
5
const { Readable } = require ( 'node:stream' )
6
6
const { once } = require ( 'node:events' )
7
7
const MemoryCacheStore = require ( '../../lib/cache/memory-cache-store' )
8
- const { nowAbsolute } = require ( '../../lib/util/timers.js' )
9
8
10
9
cacheStoreTests ( MemoryCacheStore )
11
10
@@ -33,9 +32,9 @@ function cacheStoreTests (CacheStore) {
33
32
statusCode : 200 ,
34
33
statusMessage : '' ,
35
34
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
39
38
}
40
39
const requestBody = [ 'asd' , '123' ]
41
40
@@ -73,9 +72,9 @@ function cacheStoreTests (CacheStore) {
73
72
statusCode : 200 ,
74
73
statusMessage : '' ,
75
74
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
79
78
}
80
79
const anotherBody = [ 'asd2' , '1234' ]
81
80
@@ -111,9 +110,9 @@ function cacheStoreTests (CacheStore) {
111
110
statusCode : 200 ,
112
111
statusMessage : '' ,
113
112
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
117
116
}
118
117
const requestBody = [ 'part1' , 'part2' ]
119
118
@@ -144,9 +143,9 @@ function cacheStoreTests (CacheStore) {
144
143
const requestValue = {
145
144
statusCode : 200 ,
146
145
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
150
149
}
151
150
const requestBody = [ 'part1' , 'part2' ]
152
151
@@ -178,9 +177,9 @@ function cacheStoreTests (CacheStore) {
178
177
vary : {
179
178
'some-header' : 'hello world'
180
179
} ,
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
184
183
}
185
184
const requestBody = [ 'part1' , 'part2' ]
186
185
0 commit comments