DEV Community

Discussion on: NodeJS - Unit Tests - testing without hitting database. Confusings.

Collapse
 
dukemai profile image
dukemai

from my own experience, it is easier to setup a separate database for testing and you run several scripts to prepare database before running.

If you are in deep need to run without database and you are using mongodb and moongoose, I know a library called mockgoose which is pretty good to mock db