mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-10 08:55:37 +08:00
chore: make sure MongoDbMock is using the same configuration (@fehmer) (#5792)
This commit is contained in:
parent
4466acd6bc
commit
b48854bc9d
2 changed files with 12 additions and 10 deletions
|
@ -1,15 +1,17 @@
|
|||
import * as MongoDbMock from "vitest-mongodb";
|
||||
export async function setup(): Promise<void> {
|
||||
process.env.TZ = "UTC";
|
||||
await MongoDbMock.setup({
|
||||
serverOptions: {
|
||||
binary: {
|
||||
version: "6.0.12",
|
||||
},
|
||||
},
|
||||
});
|
||||
await MongoDbMock.setup(MongoDbMockConfig);
|
||||
}
|
||||
|
||||
export async function teardown(): Promise<void> {
|
||||
await MongoDbMock.teardown();
|
||||
}
|
||||
|
||||
export const MongoDbMockConfig = {
|
||||
serverOptions: {
|
||||
binary: {
|
||||
version: "6.0.12",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { Collection, Db, MongoClient, WithId } from "mongodb";
|
||||
import { afterAll, beforeAll, afterEach } from "vitest";
|
||||
import * as MongoDbMock from "vitest-mongodb";
|
||||
import { MongoDbMockConfig } from "./global-setup";
|
||||
|
||||
process.env["MODE"] = "dev";
|
||||
//process.env["MONGOMS_DISTRO"] = "ubuntu-22.04";
|
||||
|
@ -15,9 +16,8 @@ let client: MongoClient;
|
|||
const collectionsForCleanUp = ["users"];
|
||||
|
||||
beforeAll(async () => {
|
||||
await MongoDbMock.setup({
|
||||
//don't add any configuration here, add to global-setup.ts instead.
|
||||
});
|
||||
//don't add any configuration here, add to global-setup.ts instead.
|
||||
await MongoDbMock.setup(MongoDbMockConfig);
|
||||
|
||||
client = new MongoClient(globalThis.__MONGO_URI__);
|
||||
await client.connect();
|
||||
|
|
Loading…
Reference in a new issue