0

The neo4j Java driver has access to an in-memory driver that's handy for unit testing. For example, see here and here. Does the official JavaScript driver have a similar tool? If so, how is it accessed?

Joseph Fraley
  • 1,360
  • 1
  • 10
  • 26

1 Answers1

5

There is no such tool for Javascript or any other non-jvm language. Also the example you show is not used for unit testing but for Integration Testing, hence the IT at the end of the class names.

There are lot of ways to do Integration Tests between your javascript application and a neo4j database.

  1. Simply use a neo4j instance on your local machine

  2. Spin up a docker neo4j instance : https://neo4j.com/developer/docker/

  3. Create a javascript package doing assertions against your graph, as an example in PHP : https://github.com/graphaware/php-graphunit/blob/master/src/Neo4jGraphDatabaseTestCase.php#L68

  4. Use a neo4j plugin that provides useful REST endpoints for integration testing : https://github.com/graphaware/neo4j-resttest

  5. If you use travis, spin up a neo4j instance, for example using build scripts : https://github.com/graphaware/neo4j-php-client/tree/master/build

  6. Create your own in-memory/impermanent graph database services (more hardcore to do though) : https://github.com/neo4j-contrib/rabbithole

  7. <insert other here>

Christophe Willemsen
  • 19,399
  • 2
  • 29
  • 36
  • Great, thanks for all the different strategies! Using a local instance as a throw away makes a lot of sense. The in-memory feature seems cool though, that's too bad. – Joseph Fraley Jan 08 '17 at 23:12
  • Well the in-memory actually spins up an graph database but with an Impermanent storage, I will amend my answer with an example of such usage – Christophe Willemsen Jan 08 '17 at 23:13