perf(test): reduce test startup overhead

This commit is contained in:
Peter Steinberger
2026-02-13 14:40:23 +00:00
parent 3bcde8df32
commit a7d6e44719
13 changed files with 283 additions and 286 deletions

View File

@@ -1,9 +1,8 @@
import { describe, expect, it, vi } from "vitest";
import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./config.js";
describe("broadcast", () => {
it("accepts a broadcast peer map with strategy", async () => {
vi.resetModules();
const { validateConfigObject } = await import("./config.js");
it("accepts a broadcast peer map with strategy", () => {
const res = validateConfigObject({
agents: {
list: [{ id: "alfred" }, { id: "baerbel" }],
@@ -16,18 +15,14 @@ describe("broadcast", () => {
expect(res.ok).toBe(true);
});
it("rejects invalid broadcast strategy", async () => {
vi.resetModules();
const { validateConfigObject } = await import("./config.js");
it("rejects invalid broadcast strategy", () => {
const res = validateConfigObject({
broadcast: { strategy: "nope" },
});
expect(res.ok).toBe(false);
});
it("rejects non-array broadcast entries", async () => {
vi.resetModules();
const { validateConfigObject } = await import("./config.js");
it("rejects non-array broadcast entries", () => {
const res = validateConfigObject({
broadcast: { "120363403215116621@g.us": 123 },
});