Assertions for graphology.
npm install graphology-assertionsAssertions to be used with graphology.
```
npm install graphology-assertions
- #.isGraph
- #.isGraphConstructor
- #.haveSameNodes
- #.haveSameNodesDeep
- #.areSameGraphs
- #.areSameGraphsDeep
- #.haveSameEdges
- #.haveSameEdgesDeep
Function returning whether the given value is a graphology implementation's instance.
`js
import {isGraph} from 'graphology-assertions';
const graph = new Graph();
isGraph(graph);
>>> true
isGraph(45);
>>> false
isGraph({hello: 'world'});
>>> false
`
_Arguments_
- value _any_: value to test.
Function returning whether the given value is a graphology constructor.
`js
import {isGraphConstructor} from 'graphology-assertions';
isGraphConstructor(Graph);
>>> true
isGraphConstructor(45);
>>> false
isGraphConstructor(new Graph());
>>> false
`
_Arguments_
- value _any_: value to test.
Returns whether two graphs have the same nodes.
`js
import {haveSameNodes} from 'graphology-assertions';
haveSameNodes(G, H);
`
Returns whether two graphs have the same nodes & whether those nodes have the same attributes.
`js
import {haveSameNodesDeep} from 'graphology-assertions';
haveSameNodesDeep(G, H);
`
Returns whether two graphs are the same.
`js
import {areSameGraphs} from 'graphology-assertions';
areSameGraphs(G, H);
`
Returns whether two graphs as well as their node & edge attributes are the same.
`js
import {areSameGraphsDeep} from 'graphology-assertions';
areSameGraphsDeep(G, H);
`
Returns whether two graphs have the same edges. Note that it implies that both graphs' nodes are also the same.
This is different than areSameGraphs because it will allow different graph types to be compared, e.g. a mixed graph and a directed one having the same edges nonetheless.
`js
import {haveSameEdges} from 'graphology-assertions';
haveSameEdges(G, H);
`
Returns whether two graphs have the same edges & whether those edges have the same attributes. Note that it implies that both graphs' nodes are also the same.
This is different than areSameGraphsDeep because it will allow different graph types to be compared, e.g. a mixed graph and a directed one having the same edges nonetheless.
`js
import {haveSameEdgesDeep} from 'graphology-assertions';
haveSameEdgesDeep(G, H);
``