@ts-graphviz/core 0.0.0-pr956-20240225073457 → 0.0.0-pr956-20240225091623

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/package.json +39 -16
  3. package/src/attribute.ts +0 -18
  4. package/src/core.ts +0 -5
  5. package/src/from-dot.ts +0 -73
  6. package/src/model-factory/index.ts +0 -2
  7. package/src/model-factory/model-factory-builder.test.ts +0 -79
  8. package/src/model-factory/model-factory-builder.ts +0 -55
  9. package/src/model-factory/model-factory.test.ts +0 -61
  10. package/src/model-factory/model-factory.ts +0 -40
  11. package/src/model-factory/types.ts +0 -46
  12. package/src/models/AttributeList.spec.ts +0 -58
  13. package/src/models/AttributeList.ts +0 -32
  14. package/src/models/AttributesBase.spec.ts +0 -79
  15. package/src/models/AttributesBase.ts +0 -62
  16. package/src/models/AttributesGroup.spec.ts +0 -18
  17. package/src/models/AttributesGroup.ts +0 -13
  18. package/src/models/Digraph.spec.ts +0 -17
  19. package/src/models/Digraph.ts +0 -11
  20. package/src/models/DotObject.ts +0 -5
  21. package/src/models/Edge.spec.ts +0 -48
  22. package/src/models/Edge.ts +0 -40
  23. package/src/models/Graph.spec.ts +0 -18
  24. package/src/models/Graph.ts +0 -11
  25. package/src/models/GraphBase.spec.ts +0 -364
  26. package/src/models/GraphBase.ts +0 -263
  27. package/src/models/Node.spec.ts +0 -25
  28. package/src/models/Node.ts +0 -37
  29. package/src/models/RootGraph.spec.ts +0 -69
  30. package/src/models/RootGraph.ts +0 -48
  31. package/src/models/Subgraph.spec.ts +0 -196
  32. package/src/models/Subgraph.ts +0 -44
  33. package/src/models/index.ts +0 -15
  34. package/src/models/registerModelContext.ts +0 -14
  35. package/src/to-dot.ts +0 -36
  36. package/tsconfig.json +0 -8
  37. package/typedoc.json +0 -4
  38. package/vite.config.ts +0 -22
@@ -1,62 +0,0 @@
1
- import {
2
- Attribute,
3
- AttributeKey,
4
- Attributes,
5
- AttributesEntities,
6
- AttributesObject,
7
- } from '@ts-graphviz/common';
8
- import { DotObject } from './DotObject.js';
9
-
10
- /**
11
- * Base class for DOT objects with attributes.
12
- * @group Models
13
- */
14
- export abstract class AttributesBase<T extends AttributeKey>
15
- extends DotObject
16
- implements Attributes<T>
17
- {
18
- /** @hidden */
19
- #attrs: Map<T, Attribute<T>> = new Map();
20
-
21
- constructor(attributes?: AttributesObject<T>) {
22
- super();
23
- if (attributes !== undefined) {
24
- this.apply(attributes);
25
- }
26
- }
27
-
28
- get values(): ReadonlyArray<[T, Attribute<T>]> {
29
- return Array.from(this.#attrs.entries());
30
- }
31
-
32
- get size(): number {
33
- return this.#attrs.size;
34
- }
35
-
36
- public get<K extends T>(key: K): Attribute<K> | undefined {
37
- return this.#attrs.get(key) as Attribute<K> | undefined;
38
- }
39
-
40
- public set<K extends T>(key: K, value: Attribute<K>): void {
41
- if (value !== null && value !== undefined) {
42
- this.#attrs.set(key, value);
43
- }
44
- }
45
-
46
- public delete(key: T): void {
47
- this.#attrs.delete(key);
48
- }
49
-
50
- public apply(attributes: AttributesObject<T> | AttributesEntities<T>): void {
51
- const entries = Array.isArray(attributes)
52
- ? attributes
53
- : Object.entries(attributes);
54
- for (const [key, value] of entries) {
55
- this.set(key, value);
56
- }
57
- }
58
-
59
- public clear(): void {
60
- this.#attrs.clear();
61
- }
62
- }
@@ -1,18 +0,0 @@
1
- import { beforeEach, describe, expect, test } from 'vitest';
2
- import { AttributesGroup } from './AttributesGroup.js';
3
-
4
- let attrs: AttributesGroup;
5
- beforeEach(() => {
6
- attrs = new AttributesGroup();
7
- });
8
-
9
- describe('comment', () => {
10
- test('default value to be undefined', () => {
11
- expect(attrs.comment).toBeUndefined();
12
- });
13
-
14
- test('comment can be set', () => {
15
- attrs.comment = 'test';
16
- expect(attrs.comment).toStrictEqual('test');
17
- });
18
- });
@@ -1,13 +0,0 @@
1
- import { AttributeKey, AttributesGroupModel } from '@ts-graphviz/common';
2
- import { AttributesBase } from './AttributesBase.js';
3
-
4
- /**
5
- * A set of attribute values for any object.
6
- * @group Models
7
- */
8
- export class AttributesGroup<T extends AttributeKey = AttributeKey>
9
- extends AttributesBase<T>
10
- implements AttributesGroupModel<T>
11
- {
12
- public comment?: string;
13
- }
@@ -1,17 +0,0 @@
1
- import { expect, it, test } from 'vitest';
2
- import { Digraph } from './Digraph.js';
3
- import { DotObject } from './DotObject.js';
4
- import { GraphBase } from './GraphBase.js';
5
- import './registerModelContext.js';
6
-
7
- const g = new Digraph();
8
-
9
- test('directed propaty should be true', () => {
10
- expect(g.directed).toStrictEqual(true);
11
- });
12
-
13
- it('should be instance of Digraph/GraphBase/DotObject', () => {
14
- expect(g).toBeInstanceOf(Digraph);
15
- expect(g).toBeInstanceOf(GraphBase);
16
- expect(g).toBeInstanceOf(DotObject);
17
- });
@@ -1,11 +0,0 @@
1
- import { RootGraph } from './RootGraph.js';
2
-
3
- /**
4
- * DOT object class representing a digraph.
5
- * @group Models
6
- */
7
- export class Digraph extends RootGraph {
8
- public get directed(): boolean {
9
- return true;
10
- }
11
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Base class for DOT objects.
3
- * @group Models
4
- */
5
- export abstract class DotObject {}
@@ -1,48 +0,0 @@
1
- import { beforeEach, describe, expect, it, test } from 'vitest';
2
-
3
- import './registerModelContext.js';
4
-
5
- import { EdgeTargetTuple } from '@ts-graphviz/common';
6
- import { attribute as _ } from '../attribute.js';
7
- import { DotObject } from './DotObject.js';
8
- import { Edge } from './Edge.js';
9
- import { Node } from './Node.js';
10
-
11
- let edge: Edge;
12
-
13
- const targets = [...Array(2)].map(
14
- (_, i) => new Node(`node${i + 1}`),
15
- ) as unknown as EdgeTargetTuple;
16
-
17
- beforeEach(() => {
18
- edge = new Edge(targets);
19
- });
20
-
21
- it('should be instance of Edge/DotObject', () => {
22
- expect(edge).toBeInstanceOf(Edge);
23
- expect(edge).toBeInstanceOf(DotObject);
24
- });
25
-
26
- describe('Constructor', () => {
27
- test('first argument is targets, and second attributes object', () => {
28
- edge = new Edge(targets, {
29
- [_.label]: 'Label',
30
- });
31
- expect(edge.attributes.size).toBe(1);
32
- expect(edge.attributes.get(_.label)).toBe('Label');
33
- });
34
- });
35
-
36
- it('throws an error when the EdgeTarget element is missing', () => {
37
- const n = new Node('id');
38
- expect(
39
- () => new Edge([] as unknown as EdgeTargetTuple),
40
- ).toThrowErrorMatchingInlineSnapshot(
41
- `[Error: The element of Edge target is missing or not satisfied as Edge target.]`,
42
- );
43
- expect(
44
- () => new Edge([n] as unknown as EdgeTargetTuple),
45
- ).toThrowErrorMatchingInlineSnapshot(
46
- `[Error: The element of Edge target is missing or not satisfied as Edge target.]`,
47
- );
48
- });
@@ -1,40 +0,0 @@
1
- import {
2
- AttributesGroupModel,
3
- EdgeAttributeKey,
4
- EdgeAttributesObject,
5
- EdgeModel,
6
- EdgeTargetTuple,
7
- isNodeRefLike,
8
- } from '@ts-graphviz/common';
9
- import { AttributesGroup } from './AttributesGroup.js';
10
- import { DotObject } from './DotObject.js';
11
-
12
- /**
13
- * DOT object class representing a edge.
14
- * @group Models
15
- */
16
- export class Edge extends DotObject implements EdgeModel {
17
- public get $$type(): 'Edge' {
18
- return 'Edge';
19
- }
20
-
21
- public comment?: string;
22
-
23
- public readonly attributes: AttributesGroupModel<EdgeAttributeKey>;
24
-
25
- constructor(
26
- public readonly targets: EdgeTargetTuple,
27
- attributes?: EdgeAttributesObject,
28
- ) {
29
- super();
30
- if (
31
- targets.length < 2 &&
32
- (isNodeRefLike(targets[0]) && isNodeRefLike(targets[1])) === false
33
- ) {
34
- throw Error(
35
- 'The element of Edge target is missing or not satisfied as Edge target.',
36
- );
37
- }
38
- this.attributes = new AttributesGroup(attributes);
39
- }
40
- }
@@ -1,18 +0,0 @@
1
- import { expect, it, test } from 'vitest';
2
- import { DotObject } from './DotObject.js';
3
- import { Graph } from './Graph.js';
4
- import { GraphBase } from './GraphBase.js';
5
-
6
- import './registerModelContext.js';
7
-
8
- const g = new Graph();
9
-
10
- test('directed propaty should be false', () => {
11
- expect(g.directed).toStrictEqual(false);
12
- });
13
-
14
- it('should be instance of Graph/GraphBase/DotObject', () => {
15
- expect(g).toBeInstanceOf(Graph);
16
- expect(g).toBeInstanceOf(GraphBase);
17
- expect(g).toBeInstanceOf(DotObject);
18
- });
@@ -1,11 +0,0 @@
1
- import { RootGraph } from './RootGraph.js';
2
-
3
- /**
4
- * DOT object class representing a graph.
5
- * @group Models
6
- */
7
- export class Graph extends RootGraph {
8
- get directed(): boolean {
9
- return false;
10
- }
11
- }
@@ -1,364 +0,0 @@
1
- import { beforeEach, describe, expect, it, test, vi } from 'vitest';
2
- import './registerModelContext.js';
3
-
4
- import { EdgeTargetTuple, NodeModel } from '@ts-graphviz/common';
5
- import { attribute as _ } from '../attribute.js';
6
- import { AttributesBase } from './AttributesBase.js';
7
- import { DotObject } from './DotObject.js';
8
- import { Edge } from './Edge.js';
9
- import { GraphBase } from './GraphBase.js';
10
- import { Node } from './Node.js';
11
- import { Subgraph } from './Subgraph.js';
12
-
13
- class TestGraph extends GraphBase<any> {
14
- public readonly directed = false;
15
- public strict = true;
16
- }
17
-
18
- let g: TestGraph;
19
- beforeEach(() => {
20
- g = new TestGraph();
21
- });
22
-
23
- it('should be instance of GraphBase/AttributesBase/DotObject', () => {
24
- expect(g).toBeInstanceOf(GraphBase);
25
- expect(g).toBeInstanceOf(AttributesBase);
26
- expect(g).toBeInstanceOf(DotObject);
27
- });
28
-
29
- describe('Constructor', () => {
30
- test('first argument is attributes object', () => {
31
- const root = new TestGraph({
32
- [_.label]: 'Label',
33
- });
34
- expect(root.size).toBe(1);
35
- expect(root.get(_.label)).toBe('Label');
36
- });
37
- });
38
-
39
- describe('Imperative API(addXxx existXxx removeXxx methods)', () => {
40
- test('Node operation methods works', () => {
41
- expect(g.existNode('foo')).toBe(false);
42
- const node = new Node('foo');
43
- g.addNode(node);
44
- expect(g.existNode('foo')).toBe(true);
45
- g.removeNode(node);
46
- expect(g.existNode('foo')).toBe(false);
47
- g.addNode(node);
48
- expect(g.existNode('foo')).toBe(true);
49
- g.removeNode('foo');
50
- expect(g.existNode('foo')).toBe(false);
51
- });
52
-
53
- test('Edge operation methods works', () => {
54
- const nodes = ['foo', 'bar'].map((id) =>
55
- g.createNode(id),
56
- ) as EdgeTargetTuple;
57
- const edge = new Edge(nodes);
58
- expect(g.existEdge(edge)).toBe(false);
59
- g.addEdge(edge);
60
- expect(g.existEdge(edge)).toBe(true);
61
- g.removeEdge(edge);
62
- expect(g.existEdge(edge)).toBe(false);
63
- });
64
-
65
- test('Subgraph operation methods works', () => {
66
- const sub = g.createSubgraph('sub');
67
- expect(g.existSubgraph(sub)).toBe(true);
68
- g.removeSubgraph(sub);
69
- expect(g.existSubgraph(sub)).toBe(false);
70
- g.addSubgraph(sub);
71
- expect(g.existSubgraph(sub)).toBe(true);
72
- g.removeSubgraph(sub);
73
- expect(g.existSubgraph(sub)).toBe(false);
74
- });
75
- });
76
-
77
- describe('Declarative API', () => {
78
- describe('node method', () => {
79
- describe('create node if not exists', () => {
80
- test('by id', () => {
81
- const createNodeSpy = vi.spyOn(g, 'createNode');
82
-
83
- g.node('foo');
84
- expect(g.existNode('foo')).toBe(true);
85
- expect(createNodeSpy).toHaveBeenCalledWith('foo');
86
- });
87
-
88
- test('with attributes', () => {
89
- expect(g.existNode('foo')).toBe(false);
90
- const createNodeSpy = vi.spyOn(g, 'createNode');
91
-
92
- const node = g.node('foo', {
93
- [_.label]: 'Test label',
94
- });
95
-
96
- expect(g.existNode('foo')).toBe(true);
97
- expect(createNodeSpy).toHaveBeenCalledWith('foo');
98
- expect(node.attributes.get(_.label)).toStrictEqual('Test label');
99
- });
100
-
101
- describe('callback function is given, the callback function is executed with the created node as the argument', () => {
102
- test('first argument is id, seccond argument is callback', () => {
103
- const callback = vi.fn();
104
- const node = g.node('foo', callback);
105
- expect(callback).toHaveBeenCalledWith(node);
106
- });
107
-
108
- test('first argument is id, seccond argument is attribute object, third argument is callback', () => {
109
- const callback = vi.fn();
110
- const node = g.node('foo', { [_.label]: 'Test label' }, callback);
111
- expect(callback).toHaveBeenCalledWith(node);
112
- expect(node.attributes.get(_.label)).toStrictEqual('Test label');
113
- });
114
- });
115
- });
116
-
117
- describe('get node if exists', () => {
118
- test('by id', () => {
119
- const createdNode = g.createNode('foo');
120
- const createNodeSpy = vi.spyOn(g, 'createNode');
121
-
122
- const returnedNode = g.node('foo');
123
-
124
- expect(createNodeSpy).not.toHaveBeenCalled();
125
- expect(returnedNode).toBe(createdNode);
126
- });
127
-
128
- test('with attributes', () => {
129
- const createdNode = g.createNode('foo');
130
- const createNodeSpy = vi.spyOn(g, 'createNode');
131
-
132
- const returnedNode = g.node('foo', { [_.label]: 'Test label' });
133
-
134
- expect(createNodeSpy).not.toHaveBeenCalled();
135
- expect(returnedNode).toBe(createdNode);
136
-
137
- expect(returnedNode.attributes.get(_.label)).toStrictEqual(
138
- 'Test label',
139
- );
140
- });
141
-
142
- describe('callback function is given, the callback function is executed with the created node as the argument', () => {
143
- let createdNode: NodeModel;
144
- beforeEach(() => {
145
- createdNode = g.createNode('foo');
146
- });
147
-
148
- test('first argument is id, seccond argument is callback', () => {
149
- const callback = vi.fn();
150
- const node = g.node('foo', callback);
151
- expect(callback).toHaveBeenCalledWith(node);
152
- expect(node).toBe(createdNode);
153
- });
154
-
155
- test('first argument is id, seccond argument is attribute object, third argument is callback', () => {
156
- const callback = vi.fn();
157
- const node = g.node('foo', { [_.label]: 'Test label' }, callback);
158
- expect(callback).toHaveBeenCalledWith(node);
159
- expect(node.attributes.get(_.label)).toStrictEqual('Test label');
160
- expect(node).toBe(createdNode);
161
- });
162
- });
163
- });
164
-
165
- test('apply atttibutes to nodes in graph', () => {
166
- g.node({ [_.label]: 'Test label' });
167
- expect(g.attributes.node.get(_.label)).toStrictEqual('Test label');
168
- });
169
- });
170
-
171
- describe('edge method', () => {
172
- describe('create edge', () => {
173
- let nodes: EdgeTargetTuple;
174
- beforeEach(() => {
175
- nodes = ['foo', 'bar'].map((id) => g.createNode(id)) as EdgeTargetTuple;
176
- });
177
-
178
- test('create edge with target nodes', () => {
179
- const createEdgeSpy = vi.spyOn(g, 'createEdge');
180
- g.edge(nodes);
181
- expect(createEdgeSpy).toHaveBeenCalledWith(nodes, undefined);
182
- });
183
-
184
- test('create edge and apply attribute', () => {
185
- const createEdgeSpy = vi.spyOn(g, 'createEdge');
186
- g.edge(nodes, { [_.label]: 'Test label' });
187
- expect(createEdgeSpy).toHaveBeenCalledWith(nodes, {
188
- [_.label]: 'Test label',
189
- });
190
- });
191
-
192
- test('apply atttibutes to edges in graph', () => {
193
- g.edge({ [_.label]: 'Test label' });
194
- expect(g.attributes.edge.get(_.label)).toStrictEqual('Test label');
195
- });
196
-
197
- describe('callback function is given, the callback function is executed with the created edge as the argument', () => {
198
- test('first argument is id, seccond argument is callback', () => {
199
- const callback = vi.fn();
200
- const edge = g.edge(nodes, callback);
201
- expect(callback).toHaveBeenCalledWith(edge);
202
- });
203
-
204
- test('first argument is id, seccond argument is attribute object, third argument is callback', () => {
205
- const callback = vi.fn();
206
- const edge = g.edge(nodes, { [_.label]: 'Test label' }, callback);
207
- expect(callback).toHaveBeenCalledWith(edge);
208
- expect(edge.attributes.get(_.label)).toStrictEqual('Test label');
209
- });
210
- });
211
- });
212
-
213
- test('apply atttibutes to edges in graph', () => {
214
- g.edge({ [_.label]: 'Test label' });
215
- expect(g.attributes.edge.get(_.label)).toStrictEqual('Test label');
216
- });
217
- });
218
-
219
- describe('subgraph method', () => {
220
- describe('create subgraph if not exists', () => {
221
- test('no id', () => {
222
- const createSubgraphSpy = vi.spyOn(g, 'createSubgraph');
223
- const subgraph = g.subgraph();
224
- expect(subgraph).toBeInstanceOf(Subgraph);
225
- expect(createSubgraphSpy).toHaveBeenCalled();
226
- });
227
-
228
- test('only attributes', () => {
229
- const createSubgraphSpy = vi.spyOn(g, 'createSubgraph');
230
- const subgraph = g.subgraph({ [_.label]: 'Test label' });
231
- expect(createSubgraphSpy).toHaveBeenCalled();
232
- expect(subgraph.get(_.label)).toStrictEqual('Test label');
233
- });
234
-
235
- test('by id', () => {
236
- const createSubgraphSpy = vi.spyOn(g, 'createSubgraph');
237
- g.subgraph('foo');
238
- expect(createSubgraphSpy).toHaveBeenCalledWith('foo');
239
- });
240
-
241
- test('with attributes', () => {
242
- const createSubgraphSpy = vi.spyOn(g, 'createSubgraph');
243
- const subgraph = g.subgraph('foo', { [_.label]: 'Test label' });
244
- expect(createSubgraphSpy).toHaveBeenCalledWith('foo');
245
- expect(subgraph.get(_.label)).toStrictEqual('Test label');
246
- });
247
-
248
- describe('callback function is given, the callback function is executed with the created subgraph as the argument', () => {
249
- test('first argument is callback', () => {
250
- const callback = vi.fn();
251
- const subgraph = g.subgraph(callback);
252
- expect(callback).toHaveBeenCalledWith(subgraph);
253
- });
254
-
255
- test('first argument is attribute, seccond argument is callback', () => {
256
- const callback = vi.fn();
257
- const subgraph = g.subgraph({ [_.label]: 'Test label' }, callback);
258
- expect(callback).toHaveBeenCalledWith(subgraph);
259
- expect(subgraph.get(_.label)).toStrictEqual('Test label');
260
- });
261
-
262
- test('first argument is id, seccond argument is callback', () => {
263
- const callback = vi.fn();
264
- const subgraph = g.subgraph('foo', callback);
265
- expect(callback).toHaveBeenCalledWith(subgraph);
266
- });
267
-
268
- test('first argument is id, seccond argument is attribute object, third argument is callback', () => {
269
- const callback = vi.fn();
270
- const subgraph = g.subgraph(
271
- 'foo',
272
- { [_.label]: 'Test label' },
273
- callback,
274
- );
275
- expect(callback).toHaveBeenCalledWith(subgraph);
276
- expect(subgraph.get(_.label)).toStrictEqual('Test label');
277
- });
278
- });
279
- });
280
-
281
- describe('get subgraph if exists', () => {
282
- test('by id', () => {
283
- const createdSubgraph = g.createSubgraph('foo');
284
- const createSubgraphSpy = vi.spyOn(g, 'createSubgraph');
285
-
286
- const returnedSubgraph = g.subgraph('foo');
287
-
288
- expect(createSubgraphSpy).not.toHaveBeenCalled();
289
- expect(returnedSubgraph).toBe(createdSubgraph);
290
- });
291
-
292
- test('with attributes', () => {
293
- const createdSubgraph = g.createSubgraph('foo');
294
- const createSubgraphSpy = vi.spyOn(g, 'createSubgraph');
295
-
296
- const returnedSubgraph = g.subgraph('foo', { [_.label]: 'Test label' });
297
-
298
- expect(createSubgraphSpy).not.toHaveBeenCalled();
299
- expect(returnedSubgraph).toBe(createdSubgraph);
300
-
301
- expect(returnedSubgraph.get(_.label)).toStrictEqual('Test label');
302
- });
303
- });
304
- });
305
-
306
- describe('graph method', () => {
307
- test('apply atttibutes to graphs in graph', () => {
308
- g.graph({ [_.label]: 'Test label' });
309
- expect(g.attributes.graph.get(_.label)).toStrictEqual('Test label');
310
- });
311
- });
312
- });
313
-
314
- describe('Models Context API', () => {
315
- class TestNode extends Node {}
316
- class TestEdge extends Edge {}
317
- class TestSubgraphA extends Subgraph {}
318
- class TestSubgraphB extends Subgraph {}
319
- class TestSubgraphC extends Subgraph {}
320
-
321
- describe('By providing a context in the with method, the object created by createXxx is created with the model given by the context.', () => {
322
- test('with TestNode', () => {
323
- g.with({ Node: TestNode });
324
-
325
- const node = g.createNode('hoge');
326
- expect(node).toBeInstanceOf(TestNode);
327
- });
328
-
329
- test('with TestEdge', () => {
330
- g.with({ Edge: TestEdge });
331
-
332
- const edge = g.createEdge(['foo', 'bar']);
333
- expect(edge).toBeInstanceOf(TestEdge);
334
- });
335
-
336
- test('with TestSubgraph', () => {
337
- g.with({ Subgraph: TestSubgraphA });
338
-
339
- const subgraph = g.createSubgraph();
340
- expect(subgraph).toBeInstanceOf(TestSubgraphA);
341
- });
342
-
343
- test('In nested contexts, the settings are inherited. It also does not affect the parent context.', () => {
344
- const sub = g.createSubgraph();
345
- expect(sub).toBeInstanceOf(Subgraph);
346
-
347
- sub.with({ Subgraph: TestSubgraphA });
348
- const A = sub.createSubgraph();
349
- expect(A).toBeInstanceOf(TestSubgraphA);
350
-
351
- A.with({ Subgraph: TestSubgraphB });
352
- const B = A.createSubgraph();
353
- expect(B).toBeInstanceOf(TestSubgraphB);
354
-
355
- B.with({ Subgraph: TestSubgraphC });
356
- const C = B.createSubgraph();
357
- expect(C).toBeInstanceOf(TestSubgraphC);
358
-
359
- expect(sub.createSubgraph()).toBeInstanceOf(TestSubgraphA);
360
- expect(A.createSubgraph()).toBeInstanceOf(TestSubgraphB);
361
- expect(B.createSubgraph()).toBeInstanceOf(TestSubgraphC);
362
- });
363
- });
364
- });