So you're making a node app with neo4j. Now you need to unit test all your beautiful cypher queries. Mocking the REST API calls won't verify the logic of your queries. Making REST calls against your dev database makes test isolation difficult.
Neo4j-test makes testing your app against a real neo4j a little easier. It uses loop-recur/neo4j-test-server and provides scripts to bring up and take down your test REST server.
npm install [-g] neo4j-test
[./node_modules/neo4j-test/bin/]neo4j-test [-qr]
Options:
-q
,--quiet
: Supressneo4j start
output.-r
,--repeatable
: Exit with success if a test neo4j server is already running. The defaultneo4j start
script exits with code2
if a server is running on its port.-k
,--kill
: Stop the test server.
- make
npm install
trywhich neo4j-test-server
, so users can install their own tests server and avoid the long submodule installation. - create libraries for spinning up and shutting down the server programatically.