toGraph
toGraph
is a function that allows you to convert a THREE.js object into a simple NgtTestGraphObject
.
This is useful for snapshot testing as it at least provides the scene graph structure.
1const { fixture, toGraph } = NgtTestBed.create(SceneGraph);2fixture.detectChanges();3
4expect(toGraph()).toMatchSnapshot();5
6/**7 * For a scene with a single mesh8 *9 * [10 * {11 * "type": "Mesh",12 * "name": "",13 * "children": []14 * }15 * ]16 */