File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,16 @@ export class DgraphClient {
92
92
return this . anyClient ( ) . fetchUiKeywords ( ) ;
93
93
}
94
94
95
+ /**
96
+ * getHealth gets client or cluster health
97
+ */
95
98
public async getHealth ( all : boolean = true ) : Promise < Response > {
96
99
return await this . anyClient ( ) . getHealth ( all ) ;
97
100
}
98
101
102
+ /**
103
+ * getState gets cluster state
104
+ */
99
105
public async getState ( ) : Promise < Response > {
100
106
return await this . anyClient ( ) . getState ( ) ;
101
107
}
Original file line number Diff line number Diff line change @@ -124,4 +124,23 @@ describe("clientStub", () => {
124
124
125
125
} ) ;
126
126
} ) ;
127
+
128
+ describe ( "health" , ( ) => {
129
+ it ( "should return health info" , async ( ) => {
130
+ const client = await setup ( ) ;
131
+ await client . getHealth ( ) ;
132
+ } ) ;
133
+
134
+ it ( "should return cluster health info" , async ( ) => {
135
+ const client = await setup ( ) ;
136
+ await client . getHealth ( true ) ;
137
+ } ) ;
138
+ } ) ;
139
+
140
+ describe ( "state" , ( ) => {
141
+ it ( "should return state info" , async ( ) => {
142
+ const client = await setup ( ) ;
143
+ await client . getState ( ) ;
144
+ } ) ;
145
+ } ) ;
127
146
} ) ;
You can’t perform that action at this time.
0 commit comments