@@ -15,7 +15,7 @@ describe('COMMAND', () => {
15
15
const testCases = [
16
16
{
17
17
name : 'without policies' ,
18
- input : [ 'ping' , - 1 , [ CommandFlags . STALE ] , 0 , 0 , 0 , [ CommandCategories . FAST ] , [ ] , [ ] ] satisfies CommandRawReply ,
18
+ input : [ 'ping' , - 1 , [ CommandFlags . STALE ] , 0 , 0 , 0 , [ CommandCategories . FAST ] , [ ] , [ ] , [ ] ] satisfies CommandRawReply ,
19
19
expected : {
20
20
name : 'ping' ,
21
21
arity : - 1 ,
@@ -25,12 +25,13 @@ describe('COMMAND', () => {
25
25
step : 0 ,
26
26
categories : new Set ( [ CommandCategories . FAST ] ) ,
27
27
policies : { request : undefined , response : undefined } ,
28
- isKeyless : true
28
+ isKeyless : true ,
29
+ subcommands : [ ]
29
30
}
30
31
} ,
31
32
{
32
33
name : 'with valid policies' ,
33
- input : [ 'dbsize' , 1 , [ ] , 0 , 0 , 0 , [ ] , [ 'request_policy:all_shards' , 'response_policy:agg_sum' ] , [ ] ] satisfies CommandRawReply ,
34
+ input : [ 'dbsize' , 1 , [ ] , 0 , 0 , 0 , [ ] , [ 'request_policy:all_shards' , 'response_policy:agg_sum' ] , [ ] , [ ] ] satisfies CommandRawReply ,
34
35
expected : {
35
36
name : 'dbsize' ,
36
37
arity : 1 ,
@@ -40,12 +41,13 @@ describe('COMMAND', () => {
40
41
step : 0 ,
41
42
categories : new Set ( [ ] ) ,
42
43
policies : { request : 'all_shards' , response : 'agg_sum' } ,
43
- isKeyless : true
44
+ isKeyless : true ,
45
+ subcommands : [ ]
44
46
}
45
47
} ,
46
48
{
47
49
name : 'with invalid policies' ,
48
- input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ 'request_policy:invalid' , 'response_policy:invalid' ] , [ 'some key specification' ] ] satisfies CommandRawReply ,
50
+ input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ 'request_policy:invalid' , 'response_policy:invalid' ] , [ 'some key specification' ] , [ ] ] satisfies CommandRawReply ,
49
51
expected : {
50
52
name : 'test' ,
51
53
arity : 0 ,
@@ -55,12 +57,13 @@ describe('COMMAND', () => {
55
57
step : 0 ,
56
58
categories : new Set ( [ ] ) ,
57
59
policies : { request : undefined , response : undefined } ,
58
- isKeyless : false
60
+ isKeyless : false ,
61
+ subcommands : [ ]
59
62
}
60
63
} ,
61
64
{
62
65
name : 'with request policy only' ,
63
- input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ 'request_policy:all_nodes' ] , [ 'some key specification' ] ] satisfies CommandRawReply ,
66
+ input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ 'request_policy:all_nodes' ] , [ 'some key specification' ] , [ ] ] satisfies CommandRawReply ,
64
67
expected : {
65
68
name : 'test' ,
66
69
arity : 0 ,
@@ -70,12 +73,13 @@ describe('COMMAND', () => {
70
73
step : 0 ,
71
74
categories : new Set ( [ ] ) ,
72
75
policies : { request : 'all_nodes' , response : undefined } ,
73
- isKeyless : false
76
+ isKeyless : false ,
77
+ subcommands : [ ]
74
78
}
75
79
} ,
76
80
{
77
81
name : 'with response policy only' ,
78
- input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ '' , 'response_policy:agg_max' ] , [ ] ] satisfies CommandRawReply ,
82
+ input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ '' , 'response_policy:agg_max' ] , [ ] , [ ] ] satisfies CommandRawReply ,
79
83
expected : {
80
84
name : 'test' ,
81
85
arity : 0 ,
@@ -85,12 +89,13 @@ describe('COMMAND', () => {
85
89
step : 0 ,
86
90
categories : new Set ( [ ] ) ,
87
91
policies : { request : undefined , response : 'agg_max' } ,
88
- isKeyless : true
92
+ isKeyless : true ,
93
+ subcommands : [ ]
89
94
}
90
95
} ,
91
96
{
92
97
name : 'with response policy only' ,
93
- input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ '' , 'response_policy:agg_max' ] , [ ] ] satisfies CommandRawReply ,
98
+ input : [ 'test' , 0 , [ ] , 0 , 0 , 0 , [ ] , [ '' , 'response_policy:agg_max' ] , [ ] , [ ] ] satisfies CommandRawReply ,
94
99
expected : {
95
100
name : 'test' ,
96
101
arity : 0 ,
@@ -100,7 +105,8 @@ describe('COMMAND', () => {
100
105
step : 0 ,
101
106
categories : new Set ( [ ] ) ,
102
107
policies : { request : undefined , response : 'agg_max' } ,
103
- isKeyless : true
108
+ isKeyless : true ,
109
+ subcommands : [ ]
104
110
}
105
111
}
106
112
] ;
0 commit comments