@@ -10,31 +10,31 @@ test.group('Cache Entry Options', () => {
10
10
11
11
const options = createCacheEntryOptions ( override , defaults )
12
12
13
- assert . equal ( options . logicalTtl , string . milliseconds . parse ( '10m' ) )
14
- assert . equal ( options . physicalTtl , string . milliseconds . parse ( '30m' ) )
13
+ assert . equal ( options . getLogicalTtl ( ) , string . milliseconds . parse ( '10m' ) )
14
+ assert . equal ( options . getPhysicalTtl ( ) , string . milliseconds . parse ( '30m' ) )
15
15
} )
16
16
17
17
test ( 'physical ttl should be logical ttl when grace period is disabled' , ( { assert } ) => {
18
18
const options = createCacheEntryOptions ( { ttl : '10m' } )
19
19
20
- assert . equal ( options . physicalTtl , string . milliseconds . parse ( '10m' ) )
20
+ assert . equal ( options . getPhysicalTtl ( ) , string . milliseconds . parse ( '10m' ) )
21
21
} )
22
22
23
23
test ( 'physical ttl should be grace period ttl when enabled' , ( { assert } ) => {
24
24
const options = createCacheEntryOptions ( { ttl : '10m' , grace : '30m' } )
25
- assert . equal ( options . physicalTtl , string . milliseconds . parse ( '30m' ) )
25
+ assert . equal ( options . getPhysicalTtl ( ) , string . milliseconds . parse ( '30m' ) )
26
26
} )
27
27
28
28
test ( 'null ttl should be kept and resolved to undefined' , ( { assert } ) => {
29
29
const options = createCacheEntryOptions ( { ttl : null , grace : '30m' } )
30
- assert . deepEqual ( options . logicalTtl , undefined )
30
+ assert . deepEqual ( options . getLogicalTtl ( ) , undefined )
31
31
} )
32
32
33
33
test ( 'clone with null ttl should be kept and resolved as undefined' , ( { assert } ) => {
34
34
const options = createCacheEntryOptions ( { ttl : '10m' , grace : '30m' } )
35
35
const clone = options . cloneWith ( { ttl : null } )
36
36
37
- assert . deepEqual ( clone . logicalTtl , undefined )
37
+ assert . deepEqual ( clone . getLogicalTtl ( ) , undefined )
38
38
} )
39
39
40
40
test ( 'should assign timeouts' , ( { assert } ) => {
@@ -65,8 +65,8 @@ test.group('Cache Entry Options', () => {
65
65
const r1 = createCacheEntryOptions ( { grace : false } )
66
66
const r2 = r1 . cloneWith ( { grace : '60m' } )
67
67
68
- assert . isFalse ( r1 . isGraceEnabled )
69
- assert . isTrue ( r2 . isGraceEnabled )
68
+ assert . isFalse ( r1 . getIsGraceEnabled ( ) )
69
+ assert . isTrue ( r2 . getIsGraceEnabled ( ) )
70
70
} )
71
71
72
72
test ( 'timeout should be soft one if fallback value and grace period enabled' , ( { assert } ) => {
@@ -112,7 +112,7 @@ test.group('Cache Entry Options', () => {
112
112
113
113
options . setLogicalTtl ( string . milliseconds . parse ( '5m' ) )
114
114
115
- assert . equal ( options . logicalTtl , string . milliseconds . parse ( '5m' ) )
116
- assert . equal ( options . physicalTtl , string . milliseconds . parse ( '5m' ) )
115
+ assert . equal ( options . getLogicalTtl ( ) , string . milliseconds . parse ( '5m' ) )
116
+ assert . equal ( options . getPhysicalTtl ( ) , string . milliseconds . parse ( '5m' ) )
117
117
} )
118
118
} )
0 commit comments