Skip to content

Commit 7652bfe

Browse files
author
Paul Korzhyk
committed
Allow configuring test port via DGRAPH_SERVER_ADDR env variable
1 parent 2156353 commit 7652bfe

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

tests/clientStub.spec.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ async function checkVersion(stub: dgraph.DgraphClientStub): Promise<void> {
1515
}
1616

1717
describe("clientStub", () => {
18-
describe("constructor", () => {
19-
it("should accept undefined arguments", async () => {
20-
await checkVersion(new dgraph.DgraphClientStub());
21-
});
22-
});
23-
2418
describe("login", () => {
2519
it("Really should login", async () => {
26-
const stub = new dgraph.DgraphClientStub();
20+
const client = await setup();
21+
const stub = client.anyClient();
2722

2823
await expect(stub.login("groot", "password")).resolves.toBeDefined();
2924
});

tests/helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ export function areLinReadsEqual(a: dgraph.LinRead, b: dgraph.LinRead): boolean
3131
return ans;
3232
}
3333

34-
export const SERVER_ADDR = "localhost:9080";
34+
// tslint:disable-next-line strict-boolean-expressions
35+
export const SERVER_ADDR = process.env.DGRAPH_SERVER_ADDR || "localhost:9080";
3536
export const SERVER_CREDENTIALS = grpc.credentials.createInsecure();
3637

3738
export function createClient(): dgraph.DgraphClient {

0 commit comments

Comments
 (0)