Skip to content

Commit 3c0d1c5

Browse files
committed
Fix test format
1 parent 0ac07e9 commit 3c0d1c5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tests/txn.spec.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ let client: dgraph.DgraphClient;
1111

1212
describe("txn", () => {
1313
describe("queryWithVars", () => {
14+
let uid : any;
1415
beforeAll(async () => {
1516
client = await setup();
1617
await setSchema(client, "name: string @index(exact) .");
1718

1819
const mu = new dgraph.Mutation();
1920
mu.setCommitNow(true);
2021
mu.setSetNquads('_:alice <name> "Alice" .');
21-
await client.newTxn().mutate(mu);
22+
const mutres = await client.newTxn().mutate(mu);
23+
uid = mutres.getUidsMap().get("alice")
2224
});
2325

2426
it("should query with variables", async () => {
@@ -57,7 +59,9 @@ describe("txn", () => {
5759
);
5860
let resRdf = res.getRdf_asB64();
5961
let buff = Buffer.from(resRdf, "base64");
60-
expect(buff.toString("utf-8")).toEqual("Alice");
62+
expect(buff.toString("utf-8")).toEqual(
63+
"<" + uid + '> <name> "Alice" .\n'
64+
);
6165

6266
res = await client
6367
.newTxn()
@@ -67,10 +71,13 @@ describe("txn", () => {
6771
$a: new String("Alice"), // tslint:disable-line no-construct
6872
$b: true, // non-string properties are ignored
6973
}
70-
);
74+
);
75+
7176
resRdf = res.getRdf_asB64();
7277
buff = Buffer.from(resRdf, "base64");
73-
expect(buff.toString("utf-8")).toEqual("Alice");
78+
expect(buff.toString("utf-8")).toEqual(
79+
"<" + uid + '> <name> "Alice" .\n'
80+
);
7481
});
7582

7683
it("should ignore properties with non-string values", async () => {

0 commit comments

Comments
 (0)