Testing MongoDB in Node with the MongoDB Memory Server
In this post, we'll run through testing a Node-MongoDB app, step by step. You can test MongoDB using mongodb-memory-server, an in-memory version of MongoDB that runs independently of a persistent database. A freshly spun-up mongod process starts at roughly 7 MB of memory, providing a lightweight, self-contained environment for running tests. Let's get going!