@@ -33,10 +33,10 @@ test.group('Prometheus Plugin', () => {
33
33
test ( 'register hit/miss/write/deletes events' , async ( { assert } ) => {
34
34
const { bento, registry } = createCache ( )
35
35
36
- await bento . get ( 'foo' )
37
- await bento . set ( 'foo' , 'bar' )
38
- await bento . get ( 'foo' )
39
- await bento . delete ( 'foo' )
36
+ await bento . get ( { key : 'foo' } )
37
+ await bento . set ( { key : 'foo' , value : 'bar' } )
38
+ await bento . get ( { key : 'foo' } )
39
+ await bento . delete ( { key : 'foo' } )
40
40
41
41
const hits = await registry . getSingleMetric ( 'bentocache_hits' ) ?. get ( )
42
42
const misses = await registry . getSingleMetric ( 'bentocache_misses' ) ?. get ( )
@@ -52,17 +52,17 @@ test.group('Prometheus Plugin', () => {
52
52
test ( 'register graced hits' , async ( { assert } ) => {
53
53
const { bento, registry } = createCache ( )
54
54
55
- await bento . set ( 'foo' , 'bar' , { ttl : 1 , grace : '2 ' } )
55
+ await bento . set ( { key : 'foo' , value : 'bar' , ttl : 1 , grace : '2h ' } )
56
56
57
57
await sleep ( 400 )
58
58
59
- await bento . getOrSet (
60
- 'foo' ,
61
- ( ) => {
59
+ await bento . getOrSet ( {
60
+ key : 'foo' ,
61
+ factory : ( ) => {
62
62
throw new Error ( 'Factory error' )
63
63
} ,
64
- { grace : '2h' } ,
65
- )
64
+ grace : '2h' ,
65
+ } )
66
66
67
67
const hits = await registry . getSingleMetric ( 'bentocache_hits' ) ?. get ( )
68
68
const gracedHits = await registry . getSingleMetric ( 'bentocache_graced_hits' ) ?. get ( )
@@ -84,13 +84,13 @@ test.group('Prometheus Plugin', () => {
84
84
] ,
85
85
} )
86
86
87
- await bento . set ( 'posts:1' , 'foo' )
88
- await bento . set ( 'posts:2' , 'bar' )
87
+ await bento . set ( { key : 'posts:1' , value : 'foo' } )
88
+ await bento . set ( { key : 'posts:2' , value : 'bar' } )
89
89
90
- await bento . get ( 'users:1' )
91
- await bento . get ( 'users:2' )
92
- await bento . get ( 'posts:1' )
93
- await bento . get ( 'posts:2' )
90
+ await bento . get ( { key : 'users:1' } )
91
+ await bento . get ( { key : 'users:2' } )
92
+ await bento . get ( { key : 'posts:1' } )
93
+ await bento . get ( { key : 'posts:2' } )
94
94
95
95
const hits = await registry . getSingleMetric ( 'bentocache_hits' ) ?. get ( )
96
96
const misses = await registry . getSingleMetric ( 'bentocache_misses' ) ?. get ( )
0 commit comments