@@ -21,14 +21,16 @@ describe("optionValue", () => {
21
21
...defaultOption ,
22
22
name : "Max Token Lifetime" ,
23
23
value : 3600 * 1e9 ,
24
+ annotations : { format_duration_ns : "false" } ,
24
25
} ,
25
- expected : "1 hour" ,
26
+ expected : 3600000000000 ,
26
27
} ,
27
28
{
28
29
option : {
29
30
...defaultOption ,
30
31
name : "Max Token Lifetime" ,
31
32
value : 24 * 3600 * 1e9 ,
33
+ annotations : { format_duration_ns : "true" } ,
32
34
} ,
33
35
expected : "1 day" ,
34
36
} ,
@@ -37,14 +39,16 @@ describe("optionValue", () => {
37
39
...defaultOption ,
38
40
name : "Session Duration" ,
39
41
value : 3600 * 1e9 ,
42
+ annotations : { format_duration_ns : "falsae" } ,
40
43
} ,
41
- expected : "1 hour" ,
44
+ expected : 3600000000000 ,
42
45
} ,
43
46
{
44
47
option : {
45
48
...defaultOption ,
46
49
name : "Session Duration" ,
47
50
value : 24 * 3600 * 1e9 ,
51
+ annotations : { format_duration_ns : "true" } ,
48
52
} ,
49
53
expected : "1 day" ,
50
54
} ,
@@ -109,18 +113,18 @@ describe("optionValue", () => {
109
113
...defaultOption ,
110
114
name : "Some Go Duration We Want To Show As A String" ,
111
115
value : 30 * 1e9 ,
112
- annotations : { " format_duration_ns" : "true" } ,
116
+ annotations : { format_duration_ns : "true" } ,
113
117
} ,
114
- expected : "30s " ,
118
+ expected : "30 seconds " ,
115
119
} ,
116
120
{
117
121
option : {
118
122
...defaultOption ,
119
123
name : "Some Other Go Duration We Want To Just Display As A Number" ,
120
124
value : 30 * 1e9 ,
121
- annotations : { " format_duration_ns" : "false" } ,
125
+ annotations : { format_duration_ns : "false" } ,
122
126
} ,
123
- expected : " 30000000000"
127
+ expected : 30000000000 ,
124
128
} ,
125
129
] ) (
126
130
`[$option.name]optionValue($option.value)` ,
0 commit comments