test: group remaining suite cleanups

This commit is contained in:
Peter Steinberger
2026-02-21 21:43:24 +00:00
parent 5c8f0b5a77
commit 861718e4dc
32 changed files with 870 additions and 922 deletions

View File

@@ -1,4 +1,4 @@
import { beforeEach, describe, expect, it } from "vitest";
import { beforeAll, beforeEach, describe, expect, it } from "vitest";
import { setDefaultChannelPluginRegistryForTests } from "./channel-test-helpers.js";
import { configMocks, offsetMocks } from "./channels.mock-harness.js";
import { baseConfigSnapshot, createTestRuntime } from "./test-runtime-config-helpers.js";
@@ -7,6 +7,10 @@ const runtime = createTestRuntime();
let channelsAddCommand: typeof import("./channels.js").channelsAddCommand;
describe("channelsAddCommand", () => {
beforeAll(async () => {
({ channelsAddCommand } = await import("./channels.js"));
});
beforeEach(async () => {
configMocks.readConfigFileSnapshot.mockReset();
configMocks.writeConfigFile.mockClear();
@@ -15,7 +19,6 @@ describe("channelsAddCommand", () => {
runtime.error.mockClear();
runtime.exit.mockClear();
setDefaultChannelPluginRegistryForTests();
({ channelsAddCommand } = await import("./channels.js"));
});
it("clears telegram update offsets when the token changes", async () => {