Skip to content

Commit

Permalink
perf: add performance tests for mongodb helpers too
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpza committed Sep 9, 2024
1 parent b6ac0d6 commit f37709e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 10 additions & 1 deletion tests/mongodb-extended-test/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect } from "vitest";
import { describe, expect } from "vitest";
import { mmsTest } from "vitest-mms/mongodb/test";

import { insertUser } from "./index.js";
Expand All @@ -18,3 +18,12 @@ mmsTest("check dbs are unique2", async ({ db }) => {
await insertUser(db);
expect(await db.collection("users").countDocuments()).toBe(1);
});

describe("performance", () => {
mmsTest.each(Array.from({ length: 1000 }, (_, i) => i))(
"test %i",
async () => {
expect(true).toBe(true);
},
);
});
8 changes: 7 additions & 1 deletion tests/mongodb-setup-file/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, test } from "vitest";
import { describe, expect, test } from "vitest";

import { insertUser } from "./index.js";

Expand All @@ -17,3 +17,9 @@ test("check dbs are unique2", async ({ db }) => {
await insertUser(db);
expect(await db.collection("users").countDocuments()).toBe(1);
});

describe("performance", () => {
test.each(Array.from({ length: 1000 }, (_, i) => i))("test %i", async () => {
expect(true).toBe(true);
});
});

0 comments on commit f37709e

Please sign in to comment.