I have read related post: Cannot overwrite model once compiled Mongoose
Problem is neither of these solution's helped me with my problem.
I get the error in the title and I have following setup:
Folder Structure:
My models look like this:
forums.js
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const topicGroupSchema = require("./topicGroups");
const forumSchema = new Schema({
    title: String,
    topicGroups: [topicGroupSchema]
})
const Forum = mongoose.model("forums", forumSchema);
module.exports = Forum;
topicGroups.js
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const topicGroupSchema = new Schema({
    title: String,
   // Todo: add topics
})
module.exports = topicGroupSchema;
My test_helper and saveForum_test.js files look like this:
saveForum_test.js
const assert = require("assert");
const Forum = require("../model/forums")
describe("Creating records", () => {
    it("can save a new forum", (done) => {
        const forum = new Forum({
            title: "CodeHUB"
        })
        forum.save()
            .then(() => {
                assert(forum.isNew)
                done();
            })
    })
})
test_helper.js
const mongoose = require("mongoose");
mongoose.Promise = global.Promise;
before(done => {
    mongoose.connect("mongodb://myuser:mypassword@ds221339.mlab.com:21339/clicker", { useNewUrlParser: true });
    mongoose.connection
        .once("open", () => {done()})
        .on("error", error => {
            console.warn("error", error)
        })
})
// FIXME: error when saved twice
beforeEach(done => {
    console.log(mongoose.connection.collections.forums)
    mongoose.connection.dropCollection("forums", () => {
        done();
    })
})
So when I run my test suite with mocha, everything works as expected. But when I change something, and run it again, I get the error
OverwriteModelError: Cannot overwrite
forumsmodel once compiled.
I use mlab with mongoose and not a local installed mongodb. Maybe it has something todo with that? I can't figure it out, I checked all the files and imports etc. 10 times and can't find a mistake, can you ?
