Nodeclipse SHARE home

Node.js - embeddable in-memory MongoDB instance for unit testing or Node.js mocking for MongoDB

Question by Paul Verest

We are doing unit tests for Node.js project. They depend on data that should be prepared every time test pack starts (depending on external environment like some db on other server is not good). The solution would be MongoDB instance with in-memory mode.

Possibly in the Future it will be implemented as MongoDB in-memory mode feature, but as of November 2013 it is open issue 1153

The solution for Java was named in http://stackoverflow.com/questions/6437226/embedded-mongodb-when-running-integration-tests and there are other ways mentioned

Is there Node.js mocking for MongoDB ?

Related:

Is similar to http://stackoverflow.com/questions/10378116/mock-test-mongodb-database-node-js but the question has several other questions asked.

Fork me on GitHub