Running the unit tests
If you implemented
graphology on your own and want to be sure you are compliant with the present specifications, here is how to run the unit tests:
First, you need to install
mocha from npm:
npm install --save-dev graphology mocha
Then you need to create a file that will be run by
// test.js import specs from 'graphology/specs'; import Graph from 'my-custom-graphology-implementation'; module.exports = specs(Graph, Graph);
- class function: the Graph class of your implementation.
- implementation object: an object containing the rest of the implementation (alternative constructors, errors). Note that most of the time, or at least if you export your implementation through CommonJS, the
implementationarguments will be the same.
Then, run the tests using
mocha -u exports test.js