# Testing with a Real Database

Testing with a Real Database: Testing with mongodb-memory-server.

Updated: November 19, 2026

1. [Testing with mongodb-memory-server](https://www.ask-codey.com/lessons/node-mongodb-memory-server-tests) (Journeyman): mongodb-memory-server starts a real, throwaway MongoDB for a test file, so before starts it, beforeEach gives every test the same fresh data, Supertest tests the whole API against it, and after stops it, with your own data never touched.

Source: https://www.ask-codey.com/courses/nodejs-in-depth/topics/node-mongodb-testing
