Skip to content

Commit 1f70640

Browse files
committed
tests
1 parent 7676342 commit 1f70640

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

tests/clientStub.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)