Mock/Test Mongodb Database Node.js

别等时光非礼了梦想. 提交于 2019-12-03 01:15:44

There are some

http://mongodb.github.com/node-mongodb-native/github/github.html#test-helpers-and-libraries

but you might want to just search on github or ask in the google group as well.

dule

If your database access is a separate module, you can mock out the module or parts of the module (e.g., the configuration part) using one of the following:

The answers to the following related question lists a number of possible solutions/approaches: How do you mock MySQL (without an ORM) in Node.js?

In order to spin up a real in-memory mongodb for testing, https://github.com/nodkz/mongodb-memory-server helps as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!