This repository was archived by the owner on Sep 5, 2025. It is now read-only.
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 {
9292 return this . anyClient ( ) . fetchUiKeywords ( ) ;
9393 }
9494
95+ /**
96+ * getHealth gets client or cluster health
97+ */
9598 public async getHealth ( all : boolean = true ) : Promise < Response > {
9699 return await this . anyClient ( ) . getHealth ( all ) ;
97100 }
98101
102+ /**
103+ * getState gets cluster state
104+ */
99105 public async getState ( ) : Promise < Response > {
100106 return await this . anyClient ( ) . getState ( ) ;
101107 }
Original file line number Diff line number Diff line change @@ -124,4 +124,23 @@ describe("clientStub", () => {
124124
125125 } ) ;
126126 } ) ;
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+ } ) ;
127146} ) ;
You can’t perform that action at this time.
0 commit comments