(doc = new Y.Doc())
| 30 | interface DemoSchema extends _DemoSchema {} |
| 31 | |
| 32 | function createGraph(doc = new Y.Doc()) { |
| 33 | const graph = new YGraph<DemoSchema>({ |
| 34 | schema, |
| 35 | doc, |
| 36 | }); |
| 37 | |
| 38 | const alice = graph.addVertex("Person", { name: new Y.Text("Alice") }); |
| 39 | |
| 40 | const raspberries = graph.addVertex("Thing", { |
| 41 | name: new Y.Text("Raspberries"), |
| 42 | isActive: true, |
| 43 | features: Y.Array.from<Y.Text>([new Y.Text("sweet"), new Y.Text("juicy")]), |
| 44 | }); |
| 45 | |
| 46 | graph.addEdge(alice, "likes", raspberries, {}); |
| 47 | return graph; |
| 48 | } |
| 49 | |
| 50 | test("YGraphStorage", () => { |
| 51 | const graph = createGraph(); |
no test coverage detected