import MongodbMemoryServer from "mongodb-memory-server";

describe("", () => {
    test("", async (done) => {
        const mongod = new MongodbMemoryServer();
        const name = await mongod.getDbName();
        console.log(name);
        await mongod.stop();
        done();
    });
});

import MongodbMemoryServer from "mongodb-memory-server";

describe("User Accounts", () => {
    let mongod: MongodbMemoryServer;

    beforeAll(async () => {
        mongod = new MongodbMemoryServer();
        const uri = await mongod.getUri();
    });

    afterAll(async () => {
        await mongod.stop();
    });

    test("", async () => {
        const name = await mongod.getDbName();
        console.log(name);
    });
});

Move db setup to beforeAll and afterAll
Move db setup to beforeAll and afterAll
