I have got this error:
Could not connect to MongoDB!
Error: Trying to open unclosed connection.
OverwriteModelError: Cannot overwrite
Article
model once compiled.
when I use the --watch
to run my mocha test. It is because the test runner is trying to reload the application (server.js) and it is trying to recompile models.
I find several related questions on SO but they do not specifically apply to the --watch
scenario.
I've solved that by modifying statement:
to read