MCPcopy
hub / github.com/anvaka/VivaGraphJS / assertGraphsAreSame

Function assertGraphsAreSame

test/graphSerialization.js:85–96  ·  view source on GitHub ↗
(expected, actual,t)

Source from the content-addressed store, hash-verified

83});
84
85function assertGraphsAreSame(expected, actual,t) {
86 t.equals(expected.getNodesCount(), actual.getNodesCount(), 'Number of nodes does not match for graph: ' + expected.Name);
87 t.equals(expected.getLinksCount(), actual.getLinksCount(), 'Number of links does not match for graph: ' + expected.Name);
88
89 expected.forEachNode(function(node) {
90 t.ok(actual.getNode(node.id), 'Actual graph is missing node with id: ' + node.id);
91 });
92
93 expected.forEachLink(function(link) {
94 t.ok(actual.hasLink(link.fromId, link.toId), 'Actual graph is missing link from ' + link.fromId + ' to ' + link.toId);
95 });
96}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected