Mercurial > code > home > repos > streamed-graph
comparison src/layout/json_ld_quads.test.ts @ 106:2468f2227d22
make src/layout/ and src/render/ separation
author | drewp@bigasterisk.com |
---|---|
date | Sun, 13 Mar 2022 22:00:30 -0700 |
parents | src/json_ld_quads.test.ts@8b4dc9e87b56 |
children |
comparison
equal
deleted
inserted
replaced
105:4bb8c7775c83 | 106:2468f2227d22 |
---|---|
1 import { eachJsonLdQuad } from "./json_ld_quads"; | |
2 import { Literal, DataFactory } from "n3"; | |
3 const { literal } = DataFactory; | |
4 | |
5 describe("eachJsonLdQuad", () => { | |
6 test("finds multiple graphs", () => {}); | |
7 test("returns quads", async () => { | |
8 let results: Array<any> = []; | |
9 await eachJsonLdQuad( | |
10 [ | |
11 { | |
12 "@id": "http://example.com/g1", | |
13 "@graph": [ | |
14 { | |
15 "@id": "http://example.com/s1", | |
16 "http://example.com/p1": [{ "@value": "lit1" }] | |
17 } | |
18 ] | |
19 } | |
20 ], | |
21 (res: any) => results.push(res) | |
22 ); | |
23 expect(results).toHaveLength(1); | |
24 expect(results[0].subject.value).toEqual("http://example.com/s1"); | |
25 expect(results[0].predicate.value).toEqual("http://example.com/p1"); | |
26 expect((results[0].object as Literal).equals(literal("lit1"))).toBeTruthy(); | |
27 expect(results[0].graph.value).toEqual("http://example.com/g1"); | |
28 }); | |
29 }); |